-
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
ECS Fargate Service: service not created because of alarm based rollback #26307
Comments
Could you share the difference in output between when this was working and when this was not? (i.e. cdk diff) - Additionally, when did this stop working, which version did you upgrade from to start encountering this error? |
Though this just looks like the service rejecting the configuration given your deployment controller type, but I am pretty sure that auto rollback should be able to be selected for the codedeploy controller type |
Hi +1 to this issue. Confirmed from ECS side that if using Code_Deploy type, the CreateService API would fail with Validation when "CODE_DEPLOY" and "DeploymentConfiguration.Alarm" combination detected:
And as ECS is designed that the DeploymentConfiguration.Alarm can only used by default controller AKA "ECS deployment controller". https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-alarm-failure.html I understand this new change is from this release #25840 Given it is ECS service API limitation, the L2 construct should have a judgement that if "DeploymentController.Type" is "CODE_DEPLOY", do not explicitly specify the DeploymentConfiguration.Alarms. Currently the workaround is using Escape Hatches then override deletion: Let me know if you need more clarifications. |
I upgraded from 2.81.0 to 2.87.0, That's when this issue started occuring, Weird thing is even after downgrading the CDK version to 2.81 I am getting the same error. It was working fine on Thursday last week |
When deploymentAlarms property is defined explicitly, CDK checks deploymentController is ECS or not. aws-cdk/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts Lines 632 to 636 in 9fca790
On the other hand, currently CDK never validates deploymentController property for the default alarms settings. aws-cdk/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts Lines 685 to 691 in 9fca790
I just submitted PR to fix this. |
Thanks a bunch @tam0ri! |
… 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*
Describe the bug
During the deployment process with the same code which was working previously is returning the following error.
The following is my ECS deployment group
The application is deployed using Code deploy, So the deployment controller is set as CODE_DEPLOY
Expected Behavior
ECS Cluster gets deployed successfully
Current Behavior
ECS creation failed
Reproduction Steps
Use the code in the bug description
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.87.0
Framework Version
No response
Node.js Version
v18.15.0
OS
MacOS 14.0
Language
Typescript
Language Version
5.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: