Closed andreprawira closed 11 months ago
i expect it would just leave it as is without trying to re-create the ecs cluster because there was no code change on the second run
This is how it would work if you're creating one service per account + region, and you never make any changes that cause resource replacement to your resource. You're either attempting to deploy multiple stacks/constructs with this name, or there are changes the second time you run it that cause resource replacement, which is a well documented behavior with specifying the physical name. You haven't posted a diff or details into your pipeline setup, so I cannot say what exactly is going wrong.
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.
Describe the bug
I'm using AWS CDK Python to create an ECS and i specified the cluster's service name. When i run the code in codepipeline first run works perfectly (as in fresh run, no cluster and no service ever created), it creates the cluster and the service using the correct name as it should. But when i re run the pipeline without any code change for the second time, i would get an error
Resource handler returned message: "Resource of type 'AWS::ECS::Service' with identifier 'dev-my-ecs-service' already exists." (RequestToken: 106a2ca3-6e6e-6715-8f20-0bb93b5ee61e, HandlerErrorCode: AlreadyExists)
Expected Behavior
i expect it would just leave it as is without trying to re-create the ecs cluster because there was no code change on the second run
Current Behavior
im guessing CDK thinks that there is no cluster with that name and that it should create a new one but when its trying to do so, there is already a service created using that name which was created on the previous run, im guessing so because the error message says
'dev-my-ecs-service' already exists.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.51.0 (build a87259f)
Framework Version
No response
Node.js Version
16.18.0
OS
Windows
Language
Python
Language Version
No response
Other information
No response