-
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
CDK Deploy: Deploy with hotswap now failing #26871
Comments
This should be related with #26404. I'm looking at it 👀 |
Thanks for being on top of it @tmokmss |
@jackkitley I just submitted a pr to fix it, sorry for inconvenience! In the mean time you can use cdk 2.92.0 🙏 |
## Problem ECS hotswap fails on a task definition containing log configuration like the following. ```ts const taskDefinition = new ecs.FargateTaskDefinition(stack, 'Task', {}); taskDefinition.addContainer('EcsApp', { image: ecs.ContainerImage.fromRegistry('nginx:stable'), logging: ecs.LogDriver.awsLogs({ streamPrefix: 'log' }), }); ``` ## Root cause When we transform object keys in a task definition, we pass `excludeFromTransform` to avoid from transforming keys with arbitrary string, such as [`logDriver.options`](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html#ECS-Type-LogConfiguration-options). However, it was not working when we transform keys with upperCaseFirstCharacter, because the keys in `excludeFromTransform` was uppercased, where the source object was lowercased. ``` // source task definition { "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "my-test-stack-TaskEcsAppLogGroupD5C9C1DD-BPB6zgX4S0wU", "awslogs-region": "ap-northeast-1", }, }, } // excludeFromTransform { LogConfiguration: { Options: true, }, }, } // where it should be { logConfiguration: { options: true, }, }, } ``` This misconfiguration resulted in the output task definition uppercased in an unexpected way: ```json { "logConfiguration": { "logDriver": "awslogs", "options": { "Awslogs-group": "my-test-stack-TaskEcsAppLogGroupD5C9C1DD-BPB6zgX4S0wU", "Awslogs-region": "ap-northeast-1", }, }, } ``` The problem was not detected by unit tests because they only contained cases with uppercase keys in a source task definition. ## Fix Use lowercased `excludeFromTransform` when we use it with `upperCaseFirstCharacter`, also adding a test case with lowercased keys in a source task definition. Closes #26871. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When using the following command:
cdk deploy dealeros-uat-web --hotswap -c config=uat --require-approval=never
--hotswap
is the culprit here. Without it, deploy can happen.It was working fine this morning and nothing has changed with the way we deploy.
The following error when rolling out to ECS:
Expected Behavior
--hotswap is acting up here.
I expect the code to deploy to ECS without issues.
Current Behavior
Failing the build process with --hotswap in the cdk deploy.
giving error:
Reproduction Steps
CDK version:
2.93.0 (build 724bd01)
Run this for a deploy:
cdk deploy dealeros-uat-web -c config=uat --require-approval=never
Possible Solution
This was a recent change. im not sure.
Additional Information/Context
No response
CDK CLI Version
2.93.0 (build 724bd01)
Framework Version
No response
Node.js Version
16
OS
ubuntu
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: