Skip to content

Instantly share code, notes, and snippets.

@karlsander
Created October 9, 2020 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlsander/7b257ab62a2add111e40e39b86ab48ad to your computer and use it in GitHub Desktop.
Save karlsander/7b257ab62a2add111e40e39b86ab48ad to your computer and use it in GitHub Desktop.
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