-
-
Save karlsander/7b257ab62a2add111e40e39b86ab48ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const targetGroup = new awsx.lb.ApplicationTargetGroup("hasura-lb-target-group", { | |
port: 8080, | |
protocol: "HTTP", | |
healthCheck: { | |
port: "8080", | |
protocol: "HTTP", | |
path: "/healthz" | |
} | |
}); | |
const hasuraLB = new awsx.lb.ApplicationListener("hasura-lb-https-443", { | |
port: 443, | |
protocol: "HTTPS", | |
certificateArn: dataCertificateARN, | |
targetGroup: targetGroup | |
}); | |
const hasura = new awsx.ecs.FargateService("hasura", { | |
taskDefinitionArgs: { | |
containers: { | |
hasura: { | |
image: `hasura/graphql-engine:${config.require("hasura_version")}`, | |
memory: 1024, | |
portMappings: [targetGroup], | |
environment: hasuraConfig | |
} | |
} | |
}, | |
desiredCount: 1 | |
}); | |
const hasuraRecord = new aws.route53.Record("hasuraLB", { | |
zoneId: zone.zoneId, | |
name: "data", | |
type: "A", | |
aliases: [ | |
{ | |
name: hasuraLB.loadBalancer.loadBalancer.dnsName, | |
zoneId: hasuraLB.loadBalancer.loadBalancer.zoneId, | |
evaluateTargetHealth: true | |
} | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment