Skip to content
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 diff): Unicode characters not properly recognised by the cdk diff #26703

Closed
johnfox opened this issue Aug 10, 2023 · 2 comments
Closed

(cdk diff): Unicode characters not properly recognised by the cdk diff #26703

johnfox opened this issue Aug 10, 2023 · 2 comments
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI

Comments

@johnfox
Copy link

johnfox commented Aug 10, 2023

Describe the bug

When using unicode characters in the environment variable value the cdk diff displays changes even when the content of the env. variable does not change (i.e. when the environment variable defined in the code have the same value as the one already deployed on AWS).
This was observed on ECS and Lambda services.

Expected Behavior

The cdk diff should not display changes on environment variables content when there is no change.

Current Behavior

The cdk diff displays change on environment variable content even when there is no change to the environmental variable value.

Reproduction Steps

    const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefinition', {
    });

    taskDefinition.addContainer('test-service', {
      image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
      environment: {
        'TEST_STRING': 'test',
        'TEST_SPECIAL_CHARS': 'test!@#$%^&*()_+',
        'TEST_UNICODE_CHARS': 'test😀',
        'TEST_CURRENCY_CHARS': 'test ¥ $ € £',
      }
    });

    const service = new ecs.FargateService(this, 'Service', {
      cluster,
      taskDefinition,
      serviceName: 'test-service',
      vpcSubnets: { subnets: vpc.privateSubnets },
    });

cdk diff call result after the stack is deployed and no change made to the code:

Stack UnexpectedCharactersInEnvDiffStack
Resources
[~] AWS::ECS::TaskDefinition TaskDefinition TaskDefinitionB36D86D9 replace
 └─ [~] ContainerDefinitions (requires replacement)
     └─ @@ -11,11 +11,11 @@
        [ ]   },
        [ ]   {
        [ ]     "Name": "TEST_UNICODE_CHARS",
        [-]     "Value": "test?"
        [+]     "Value": "test😀"
        [ ]   },
        [ ]   {
        [ ]     "Name": "TEST_CURRENCY_CHARS",
        [-]     "Value": "test ? $ ? ?"
        [+]     "Value": "test ¥ $ € £"
        [ ]   }
        [ ] ],
        [ ] "Essential": true,

Possible Solution

No response

Additional Information/Context

The value is correctly set and available in correct form to the ECS container. So I guess the problem is either in the way the DIFF is obtained (saved version of the CF template on the AWS side my not support Unicode?).

CDK CLI Version

2.84.0 (build f7c792f)

Framework Version

2.84.0

Node.js Version

18.16.0

OS

Mac OS X

Language

Typescript

Language Version

No response

Other information

No response

@johnfox johnfox added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 10, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Aug 10, 2023
@peterwoodworth
Copy link
Contributor

This was fixed in #25912, you should only need to upgrade to 2.85.0 to see this fixed

@peterwoodworth peterwoodworth removed the needs-triage This issue or PR still needs to be triaged. label Aug 10, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

2 participants