Skip to content

Commit 6bc01c9

Browse files
authored
fix(route53): avoid setting unnecessary properties for Recovery Control type Route53 health check (#34272)
### Issue # (if applicable) Closes #34262 ### Reason for this change Unnecessary properties are set for Route53 health checks for Recovery Control type. ### Description of changes If HealthCheck type is Recovery Control, return `undefined` as default value for three properties (`FailureThreshold`, `RequestInterval`, and `MeasureLatency`). ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Used `Match.absent()` to validate that the above three properties are not explicitly specified in existing unit tests. And added test cases to the integration tests ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 3fe8ab4 commit 6bc01c9

File tree

12 files changed

+20045
-21369
lines changed

12 files changed

+20045
-21369
lines changed
Lines changed: 19315 additions & 20189 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/aws-cdk-route53-health-check.assets.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/aws-cdk-route53-health-check.template.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,74 @@
331331
"Type": "A",
332332
"Weight": 0
333333
}
334+
},
335+
"Cluster": {
336+
"Type": "AWS::Route53RecoveryControl::Cluster",
337+
"Properties": {
338+
"Name": "cluster"
339+
}
340+
},
341+
"RoutingControl": {
342+
"Type": "AWS::Route53RecoveryControl::RoutingControl",
343+
"Properties": {
344+
"ClusterArn": {
345+
"Fn::GetAtt": [
346+
"Cluster",
347+
"ClusterArn"
348+
]
349+
},
350+
"Name": "routing-control-name"
351+
}
352+
},
353+
"HealthCheckRecoveryControl984D4A84": {
354+
"Type": "AWS::Route53::HealthCheck",
355+
"Properties": {
356+
"HealthCheckConfig": {
357+
"Inverted": false,
358+
"RoutingControlArn": {
359+
"Fn::GetAtt": [
360+
"RoutingControl",
361+
"RoutingControlArn"
362+
]
363+
},
364+
"Type": "RECOVERY_CONTROL"
365+
}
366+
}
367+
},
368+
"ARecordRecoveryControl04C35A7A": {
369+
"Type": "AWS::Route53::RecordSet",
370+
"Properties": {
371+
"HealthCheckId": {
372+
"Ref": "HealthCheckRecoveryControl984D4A84"
373+
},
374+
"HostedZoneId": {
375+
"Ref": "HostedZoneDB99F866"
376+
},
377+
"Name": "_recoverycontrol.cdk.test.",
378+
"ResourceRecords": [
379+
"1.2.3.4"
380+
],
381+
"SetIdentifier": "WEIGHT_100_ID_awscdkroute53healthchRecordRecoveryControl33B4E614",
382+
"TTL": "1800",
383+
"Type": "A",
384+
"Weight": 100
385+
}
386+
},
387+
"ARecordRecoveryControl24A358DFD": {
388+
"Type": "AWS::Route53::RecordSet",
389+
"Properties": {
390+
"HostedZoneId": {
391+
"Ref": "HostedZoneDB99F866"
392+
},
393+
"Name": "_recoverycontrol.cdk.test.",
394+
"ResourceRecords": [
395+
"5.6.7.8"
396+
],
397+
"SetIdentifier": "WEIGHT_0_ID_awscdkroute53healthcheRecordRecoveryControl260B8110C",
398+
"TTL": "1800",
399+
"Type": "A",
400+
"Weight": 0
401+
}
334402
}
335403
},
336404
"Outputs": {
@@ -389,6 +457,25 @@
389457
"Export": {
390458
"Name": "aws-cdk-route53-health-check:ExportsOutputRefHealthCheckCloudWatch996681BBF4DB146D"
391459
}
460+
},
461+
"ExportsOutputFnGetAttRoutingControlRoutingControlArnDB738AE3": {
462+
"Value": {
463+
"Fn::GetAtt": [
464+
"RoutingControl",
465+
"RoutingControlArn"
466+
]
467+
},
468+
"Export": {
469+
"Name": "aws-cdk-route53-health-check:ExportsOutputFnGetAttRoutingControlRoutingControlArnDB738AE3"
470+
}
471+
},
472+
"ExportsOutputRefHealthCheckRecoveryControl984D4A84E3A8C585": {
473+
"Value": {
474+
"Ref": "HealthCheckRecoveryControl984D4A84"
475+
},
476+
"Export": {
477+
"Name": "aws-cdk-route53-health-check:ExportsOutputRefHealthCheckRecoveryControl984D4A84E3A8C585"
478+
}
392479
}
393480
},
394481
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.health-check.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json

Lines changed: 69 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)