-
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
aws_ecr_assets.DockerImageAsset: cannot deploy more than one stack simultaneously because of the image tag #30278
Comments
I'd like to know more about how you deploy them. Are you deploying multiple stacks using the same |
No, what I meant by simultaneous deployment is that we have a UI system where the user can click "Update" on several applications=stacks (any that have an update available). These stacks are deployed using the same cdk template, but the environment variables are different for each of them (e.g., So the region is the same but the environment variables used in the stacks are obviously different. You can think of it in the following way: We have stack A with the
And if we have stack B with the
When the user clicks "Update", we start a build inside of a CodeBuild project. So for several "updates", several builds of the same CodeBuild project are run. So deploy of each stack is isolated, has its own environment variables and happens at the user click. |
OK this sounds like a race condition when two isolate builds doing According to this
I guess you will need to define |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
In my aws-cdk stack deployed in
eu-north-1
region, I define DockerImageAsset as follows:The asset is then referenced as an image for a CodeBuild project later in the code.
The problem arises when I deploy two or more stacks using the same template (obviously, the stack names are different) simultaneously. Image tag is most likely generated using the datetime info, which leads to the tags being the same for several images generated in the same timeframe (the same minute?).
Here's the error I receive when the stack fails:
If I wait at least one minute before I start another deploy, it all works fine. However, it is not realistic in the production environment, where several deploys can be started on the same account in the same minute.
The only customizable thing I see is the asset_name that doesn't seem to influence anything.
Expected Behavior
I expected several stacks to deploy fine and several images to be created with different tags.
Current Behavior
Reproduction Steps
Create a cdk template with a DockerImageAsset:
Deploy several stacks using the template at the same time (same minute).
Possible Solution
Image tag is probably generated based on the time. Change the generation method.
Additional Information/Context
The
cdk deploy
command is run inside a Docker container (a separate build for every stack).CDK CLI Version
2.133.0
Framework Version
No response
Node.js Version
18
OS
ubuntu:20.04
Language
Python
Language Version
Python 3.9.19
Other information
No response
The text was updated successfully, but these errors were encountered: