-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ecs): enable alarm-based rollbacks (#25840)
This PR enables the new Deployment Alarms feature in ECS for Service L2s [blog post](https://aws.amazon.com/blogs/containers/automate-rollbacks-for-amazon-ecs-rolling-deployments-with-cloudwatch-alarms/). This PR contains changes after the first round of revision by the CDK team. Continuation of #25346 **Why are so many integration tests impacted by this change? There are 2 reasons:** 1. This PR changes the ECS L2s to set the default configuration for the `CfnService.deploymentConfiguration.alarms` property to: ``` alarmNames: [], rollback: false, enable: false, ``` This is necessary, because adding deployment alarms, deploying your CFN stack, then removing the deployment alarms from the CFN template, and deploying again WILL NOT remove the deployment alarms from the service. To remove previously configured deployment alarms, you must explicitly use the configuration shown above. Making this update will cause no interruption to existing ECS services, and does not trigger any update to the service itself during the CFN update. The ECS UpdateService API is stateful, meaning that if a field is not present in the CloudFormation object, it will be ignored in the update. This was originally implemented due to the problems with desiredCount resetting to bad values after autoscaling changed it, but requires us to set an explicit disableDeploymentAlarms() method to cause the service update to behave correctly. 2. Most ECS integ tests have not been executed in a long time. So, many of the changes are bring the snapshots up to date with the latest integ test format, or lambda layers, etc. **Detailed list of changes:** - entire alarm based rollback task into single commit - resolving merge conflicts - integ files modules updated to resolve merge conflicts - regarding merge conflicts issue - integ files import changes for merge conflicts - adding this change for PR not to abondended - chore: refactor createAlarm & remove unnecessary unit tests - chore: fix api but failing unit tests - chore: fix validation - chore: readme changes - chore: fix integ test, remove unnecessary ec2 test - chore: refactor enableAlarms for clarity - test: fix integ test, finally - docs: update docstrings for new props and methods ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
305 changed files
with
40,893 additions
and
5,353 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...yment-group.js.snapshot/EcsDeploymentGroupTestDefaultTestDeployAssert60AABFA0.assets.json
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
6 changes: 3 additions & 3 deletions
6
...edeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.assets.json
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
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
2 changes: 1 addition & 1 deletion
2
...g/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/cdk.out
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"21.0.0"} | ||
{"version":"32.0.0"} |
2 changes: 1 addition & 1 deletion
2
...ramework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/integ.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "21.0.0", | ||
"version": "32.0.0", | ||
"testCases": { | ||
"EcsDeploymentGroupTest/DefaultTest": { | ||
"stacks": [ | ||
|
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
Oops, something went wrong.