Skip to content

Commit

Permalink
Merge pull request #2 from soliantconsulting/feature/ecs-health-check
Browse files Browse the repository at this point in the history
feat: add health check to ecs container and enable execute command
  • Loading branch information
DASPRiD authored Mar 10, 2024
2 parents 1204e61 + 116fc97 commit 9571e29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions skeleton/templates/cdk/src/api-stack.ts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class ApiStack extends Stack {
instanceType: InstanceType.of(InstanceClass.BURSTABLE3, InstanceSize.MEDIUM),
autoMinorVersionUpgrade: true,
allowMajorVersionUpgrade: true,
enablePerformanceInsights: true,
}),
defaultDatabaseName: "api",
backup: {
Expand Down Expand Up @@ -150,6 +151,14 @@ export class ApiStack extends Stack {
// than assigning a NAT gateway. In a large project, consider moving the tasks into a private subnet with
// egress instead and enable NAT gateway.
taskSubnets: { subnetType: SubnetType.PUBLIC },
healthCheck: {
command: ['CMD-SHELL', 'busybox wget -O /dev/null -T 5 http://127.0.0.1:80/health || exit 1'],
startPeriod: Duration.seconds(10),
timeout: Duration.seconds(6),
retries: 3,
interval: Duration.seconds(30),
},
enableExecuteCommand: true,
assignPublicIp: true,
publicLoadBalancer: true,
healthCheckGracePeriod: Duration.seconds(10),
Expand Down

0 comments on commit 9571e29

Please sign in to comment.