Skip to content

Commit 063e5ec

Browse files
committed
Match existing healthcheck settings for now
1 parent 99391a1 commit 063e5ec

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

cdk/lib/__snapshots__/report.test.ts.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,11 +1234,11 @@ dpkg -i /tmp/\${App}_1.0-latest_all.deb
12341234
},
12351235
"TargetGroupReport53648E3B": {
12361236
"Properties": {
1237-
"HealthCheckIntervalSeconds": 10,
1237+
"HealthCheckIntervalSeconds": 30,
12381238
"HealthCheckPath": "/healthcheck",
12391239
"HealthCheckProtocol": "HTTP",
1240-
"HealthCheckTimeoutSeconds": 5,
1241-
"HealthyThresholdCount": 5,
1240+
"HealthCheckTimeoutSeconds": 10,
1241+
"HealthyThresholdCount": 2,
12421242
"Port": 9000,
12431243
"Protocol": "HTTP",
12441244
"Tags": [
@@ -1274,7 +1274,7 @@ dpkg -i /tmp/\${App}_1.0-latest_all.deb
12741274
},
12751275
],
12761276
"TargetType": "instance",
1277-
"UnhealthyThresholdCount": 2,
1277+
"UnhealthyThresholdCount": 10,
12781278
"VpcId": {
12791279
"Ref": "GuCdkVpcId",
12801280
},
@@ -2675,11 +2675,11 @@ dpkg -i /tmp/\${App}_1.0-latest_all.deb
26752675
},
26762676
"TargetGroupReport53648E3B": {
26772677
"Properties": {
2678-
"HealthCheckIntervalSeconds": 10,
2678+
"HealthCheckIntervalSeconds": 30,
26792679
"HealthCheckPath": "/healthcheck",
26802680
"HealthCheckProtocol": "HTTP",
2681-
"HealthCheckTimeoutSeconds": 5,
2682-
"HealthyThresholdCount": 5,
2681+
"HealthCheckTimeoutSeconds": 10,
2682+
"HealthyThresholdCount": 2,
26832683
"Port": 9000,
26842684
"Protocol": "HTTP",
26852685
"Tags": [
@@ -2715,7 +2715,7 @@ dpkg -i /tmp/\${App}_1.0-latest_all.deb
27152715
},
27162716
],
27172717
"TargetType": "instance",
2718-
"UnhealthyThresholdCount": 2,
2718+
"UnhealthyThresholdCount": 10,
27192719
"VpcId": {
27202720
"Ref": "GuCdkVpcId",
27212721
},

cdk/lib/report.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,22 @@ export class Report extends GuStack {
7777
executionStatement: `dpkg -i /report/${app}_1.0-latest_all.deb`,
7878
},
7979
},
80+
// Match existing healthcheck settings for now
81+
healthcheck: {
82+
healthyThresholdCount: 2,
83+
interval: Duration.seconds(30), // This seems unusually high - the default is 10s
84+
timeout: Duration.seconds(10), // The default is 5s
85+
unhealthyThresholdCount: 10, // This also seems unusually high - the default is 2
86+
},
8087
});
8188

89+
//TODO check if this customisation is really necessary (it has been copied across from
90+
// the legacy infrastructure. The 30s healthcheck interval (see above) is probably part
91+
// of the problem here.
92+
const cfnAsg = playApp.autoScalingGroup.node
93+
.defaultChild as CfnAutoScalingGroup;
94+
cfnAsg.healthCheckGracePeriod = Duration.seconds(400).toSeconds();
95+
8296
//TODO replace configure-aws-kinesis-agent with devx-logs?
8397
playApp.autoScalingGroup.userData.addCommands(
8498
`/opt/aws-kinesis-agent/configure-aws-kinesis-agent ${this.region} mobile-log-aggregation-${this.stage} /var/log/${app}/application.log`,
@@ -91,11 +105,6 @@ export class Report extends GuStack {
91105
// This is needed to dual-stack; it can be removed once the legacy infrastructure is cleaned up
92106
Tags.of(playApp.autoScalingGroup).add('gu:riffraff:new-asg', 'true');
93107

94-
//TODO check if this customisation is really necessary (copied across from YAML for now)
95-
const cfnAsg = playApp.autoScalingGroup.node
96-
.defaultChild as CfnAutoScalingGroup;
97-
cfnAsg.healthCheckGracePeriod = Duration.seconds(400).toSeconds();
98-
99108
// In the Mobile account there are separate artifact buckets for different groups of applications, so we can't use
100109
// the account-wide default
101110
const distBucketParameterName = '/account/services/artifact.bucket.n10n';

0 commit comments

Comments
 (0)