-
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
aws_ecs.service: Cannot update service if service revisions is active #33195
Comments
Thanks, @pahud for the thorough response. Really appreciated. That all makes sense. You're correct, we're using ecs-deploy in our CD to create an updated task definition that references a new container image and patch the service like so:
I think I'm being greedy and wanting the best of both worlds. I want to control everything in CDK other than the task-def reference to the new git-sha, treating the infra and the container image ref as separate concerns. I suppose I could replace the ecs-deploy step with a cdk deploy that does basically the same, but right now cdk is in its own repo to handle shared components and such. One other work-around I though of was to use |
Describe the bug
When an ECS service has service revisions enabled, cdk cannot update the associated stack unless other stack changes trigger a re-deployment.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I would expect that cdk would handle this state gracefully/consistently and not leave the stack in an unmodifiable state.
In the current config, our preference would be for cdk to handle this change even if the revision has been triggered externally by a CD tool. I get that ideally, CD might trigger a CDK update to the stack rather than having it triggered by another tool, but that type of gitops config isn't always possible.
Current Behavior
"Invalid request provided: UpdateService error: TaskDefinition is inactive (Service: AmazonECS; Status Code: 400; Error Code: ClientException"
I have attempted this change when with the task definition versioning managed by CDK and without (task def updated by CLI). Both produce the same error.
Reproduction Steps
Deploy a service.
Deploy a revision of the service. (via cdk or cli)
Attempt to update the stack with changes that do not trigger a service re-deployment (like replica count).
Possible Solution
This appears to be because ECS keeps the prior revision attached to the service, but set as inactive. Example: If I select the "source" revision in the screenshot above, that task definition version is listed as inactive. This makes sense, but possibly there is a way to safely handle this by either triggering a re-deploy or ignoring the inactive revision.
Additional Information/Context
No response
CDK CLI Version
2.176.0
Framework Version
No response
Node.js Version
18.16
OS
MacOS Sequoia
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: