Skip to content

Commit

Permalink
Flower, DNS, and Redirects (#10948)
Browse files Browse the repository at this point in the history
* fixing protocol issue

* swapping to HTTP

* removing certificate

* remove listener temporarily

* just remove listener

* update back

* fixing connection URL

* fixing to interpolate

* fixing tostring

* updates to production
  • Loading branch information
kammerdiener authored Nov 2, 2022
1 parent c0e9021 commit 2c68c15
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
53 changes: 32 additions & 21 deletions infra/production/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,15 @@ const certificateValidation = new aws.acm.CertificateValidation("certificateVali
validationRecordFqdns: [certificateValidationDomain.fqdn],
});

// c.gitcoin.co
const c_gitcoin_co = new aws.acm.Certificate("c-gitcoin-co", {
domainName: "c.gitcoin.co",
tags: {
Environment: "production",
},
validationMethod: "DNS",
});

// Create the listener for the application
// const listener = new awsx.lb.ApplicationListener("app", {
// port: 443,
Expand Down Expand Up @@ -390,9 +399,9 @@ const staticBucket = new aws.lb.ListenerRule("static", {
actions: [{
type: "redirect",
redirect: {
host: "go.gitcoin.co",
port: "443",
protocol: "HTTPS",
host: "52.10.118.130",
port: "80",
protocol: "HTTP",
statusCode: "HTTP_301",
},
}],
Expand Down Expand Up @@ -806,24 +815,26 @@ const celery = new awsx.ecs.FargateService("celery", {
},
});

// const flower = new awsx.ecs.FargateService("flower", {
// cluster,
// desiredCount: 2,
// taskDefinitionArgs: {
// containers: {
// celery: {
// image: "mher/flower",
// command: ["flower", "--broker=" + redisConnectionUrl, "--port=8888"],
// memory: 4096,
// cpu: 2000,
// portMappings: [],
// environment: environment,
// dependsOn: [],
// links: []
// },
// },
// },
// });
const flowerBrokerString = pulumi.interpolate`--broker=${redisConnectionUrl}`.apply.toString();

const flower = new awsx.ecs.FargateService("flower", {
cluster,
desiredCount: 1,
taskDefinitionArgs: {
containers: {
celery: {
image: "mher/flower",
command: ["celery", "flower", "-A" , flowerBrokerString , "taskapp", "--port=5555"],
memory: 4096,
cpu: 2000,
portMappings: [],
environment: environment,
dependsOn: [],
links: []
},
},
},
});

const ecsTarget = new aws.appautoscaling.Target("autoscaling_target", {
maxCapacity: 10,
Expand Down
17 changes: 5 additions & 12 deletions infra/staging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,12 @@ const target = alb.createTargetGroup(
"web-target", { vpc, port: 80 }
);

const flowerTarget = alb.createTargetGroup(
"flower-target", { vpc, port: 5555, protocol: "HTTPS" }
);

// Listen to traffic on port 443 & route it through the target group
const httpsListener = target.createListener("web-listener", {
port: 443,
certificateArn: certificateValidation.certificateArn
});

const flowerListener = flowerTarget.createListener("flower-listener", {
port: 5555,
certificateArn: certificateValidation.certificateArn
});

const staticBucket = new aws.lb.ListenerRule("static", {
listenerArn: httpsListener.listener.arn,
priority: 100,
Expand Down Expand Up @@ -781,17 +772,19 @@ const celery = new awsx.ecs.FargateService("celery", {
},
});

const flowerBrokerString = pulumi.interpolate`--broker=${redisConnectionUrl}`.apply.toString();

const flower = new awsx.ecs.FargateService("flower", {
cluster,
desiredCount: 2,
desiredCount: 1,
taskDefinitionArgs: {
containers: {
celery: {
image: "mher/flower",
command: ["celery", "flower", "-A" , "taskapp", "--port=5555"],
command: ["celery", "flower", "-A" , flowerBrokerString , "taskapp", "--port=5555"],
memory: 4096,
cpu: 2000,
portMappings: [flowerListener],
portMappings: [],
environment: environment,
dependsOn: [],
links: []
Expand Down

0 comments on commit 2c68c15

Please sign in to comment.