-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ecs): enable alarm-based rollbacks #25840
Conversation
Closes aws#24243. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bvtujo, thanks for your patience on this one. It was a bit of a challenge.
All of my feedback I have implemented in another branch, which you can merge into your branch if you are aligned with it. Checkout the commit here: 8017b6f?diff=split
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks for incorporating all of my feedback. I have a few tiny comments remaining on the documentation.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
… CODE_DEPLOY and EXTERNAL deployment controller (#26317) From #25840, ECS L2 construct sets the default configuration for the `CfnService.deploymentConfiguration.alarms` property to: ``` alarmNames: [], rollback: false, enable: false, ``` However, alarm based rollback feature is only supported for ECS services that use the rolling update (ECS) deployment controller. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-alarm-failure.html Due to this limitation, when deploymentController is set to CODE_DEPLOY or EXTERNAL, creation for the service will fail by conflict with `deploymentConfiguration.alarms` property. This PR solves the issue by skipping to set default configuration for the `CfnService.deploymentConfiguration.alarms` property for CODE_DEPLOY and EXTERNAL deployment controller. Closes #26307 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… CODE_DEPLOY and EXTERNAL deployment controller (aws#26317) From aws#25840, ECS L2 construct sets the default configuration for the `CfnService.deploymentConfiguration.alarms` property to: ``` alarmNames: [], rollback: false, enable: false, ``` However, alarm based rollback feature is only supported for ECS services that use the rolling update (ECS) deployment controller. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-alarm-failure.html Due to this limitation, when deploymentController is set to CODE_DEPLOY or EXTERNAL, creation for the service will fail by conflict with `deploymentConfiguration.alarms` property. This PR solves the issue by skipping to set default configuration for the `CfnService.deploymentConfiguration.alarms` property for CODE_DEPLOY and EXTERNAL deployment controller. Closes aws#26307 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…ttings (#30217) ### Issue # (if applicable) Internal ticket tracking V1142791950 ### Reason for this change Originally in this PR #25840, we added default deployment alarm settings to fix an issue where 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. ECS now already supports default deployment alarm settings. We will remove the default setting of deploymentAlarms. Reason for removing this default behaviour is for region build where the deployment alarm service may not be available in new regions but is set by default by CDK. ### Description of changes Remove default deployment alarm. ### Description of how you validated changes All new tests and integration tests pass. ### Checklist - [ ] 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*
…ttings (aws#30217) ### Issue # (if applicable) Internal ticket tracking V1142791950 ### Reason for this change Originally in this PR aws#25840, we added default deployment alarm settings to fix an issue where 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. ECS now already supports default deployment alarm settings. We will remove the default setting of deploymentAlarms. Reason for removing this default behaviour is for region build where the deployment alarm service may not be available in new regions but is set by default by CDK. ### Description of changes Remove default deployment alarm. ### Description of how you validated changes All new tests and integration tests pass. ### Checklist - [ ] 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*
This PR enables the new Deployment Alarms feature in ECS for Service L2s blog post.
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:
CfnService.deploymentConfiguration.alarms
property to: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.
Detailed list of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license