Can't change defaultCloudMapNamespace on the cluster
While changing the ECS defaultCloudMapNamespace, a deployment causes this error:
Resource handler returned message: "Invalid request provided: UpdateService error: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException
Is there any way to force the deployment using this construct? Or any other way around?
Can you share a snippet of code where you used the construct?
I built an app to show the issue. It seems I was mistaken on the source of the issue, it triggers the error when adding cloudMapOptions to an Ec2Service, line 140 at ecstest-stack.ts .
Clone the code from: https://github.com/Ismael/cdkecstest , edit bin/ecstest.ts with your vpc and ecs codedeploy role. Deploy once, then uncomment after line 140 and deploy. This should trigger the error.
Does it only fail if you deploy first without cloudmap and then update stack to add cloudmap?
Yes.
Thanks for the sample code. Unfortunately, this is a limitation with configuring ECS Services to use CODE_DEPLOY for the deployment controller. See: https://github.com/aws/aws-cdk/issues/23564
Is there any workaround? I don't know enough about the internals, but maybe using cdk to create only the task definition and using EcsDeployment to actually trigger it?
No, not that I'm aware of.
I found the upstream issue was recently closed as shipped: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1529 Is this issue still relevant?