-
Notifications
You must be signed in to change notification settings - Fork 4k
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): (Ecs Service now Depends on Task Definition forcing Update to Existing Services) #25777
Comments
From I can see in the aws-codedeploy README of #22295
Looks like you are trying to update the ecs service with CDK with |
Hi @pahud, the update was an unintentional side effect of the change introduced in v2.50.0. From my end, I only upgraded my dependencies and tried to deploy. Upon further inspection, the new CDK version adds a dependency into the fargate service triggering an update. Here's my template in the Cloudformation dashboard:
This is the one compiled/built locally using version 2.50.0:
Notice the These are the lines of codes that was introduced in v2.50.0 that is now adding dependency in the fargate service. aws-cdk/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts Lines 573 to 579 in 1d7a9a8
Hope this helps. Thank you. |
This happened again with #25840 and 2.87.0.
|
having the same issue when we've updated the version of |
Hi, we also have this issue, because we are using Can you possibly add a feature flag to disable this new feature? Otherwise, we can not upgrade our CDK version for our existing infrastructure. |
I am not sure if the dependency is necessary As a workaround, I guess you probably can remove it with removeDependency if you really have to? |
I found a fix for this by doing I was able to upgrade to CDK 2.95.0 by adding this below my ECS service construct. |
Hi @pahud, I tried this workaround but it doesn't seem to work. Could you point out if I'm doing something wrong, please?
|
It seems like the dependency is being added on the node level rather than the defaultChild level. Are the two technically the same? There is currently no removeDependency in the node object. In the addOverride option, I can:
But the problem is this removes all the dependencies. My Cloudformation has already one declared dependency and doing this will still cause a force update on the fargate service. |
@vishnus17 Thank you, that worked for us for CDK 2.163.1. |
Describe the bug
I'm upgrading from CDK version
2.25.0
to2.81.0
. With no other changes on the stack aside from the upgrade, I'm getting an error in Cloudformation:I have compared the template from the Cloudformation and the local template built using the upgraded version and I can see the addition of the task definition in the DependsOn.
I have narrowed down which version this was introduced. It seems to occur since version
2.50.0
. I believe this line in particular was causing the fargate service to update. However, as I'm usingDeploymentControllerType.CODE_DEPLOY
this causes the above error for already created services.https://github.com/aws/aws-cdk/pull/22295/files#diff-becce6466790cd3cc81807ab64dd5f4ef85eed0285509d1ae43b381f24aefddaR469
Expected Behavior
Dependencies are not added if not required.
Current Behavior
Task definition is added as dependency on the fargate service forcing updates on existing resources.
Reproduction Steps
Build and deploy using v2.25.0
Build and deploy using 2.50.0
Possible Solution
If not required, can we remove the task definition from the list of the fargate service dependencies?
Additional Information/Context
No response
CDK CLI Version
2.50.0
Framework Version
No response
Node.js Version
v16.20.0
OS
Ubuntu 20.04.5 LTS (WSL)
Language
Typescript
Language Version
Typescript ~4.6.4
Other information
No response
The text was updated successfully, but these errors were encountered: