[cli] cdk diff always reports diff if resource has non-ASCII characters
See original GitHub issuecdk diff
always reports diff if resource has non-ASCII characters.
Reproduction Steps
import * as cdk from "@aws-cdk/core";
import * as codebuild from "@aws-cdk/aws-codebuild";
const app = new cdk.App();
const stack = new cdk.Stack(app, "stack1");
new codebuild.Project(stack, "FooProject", {
buildSpec: codebuild.BuildSpec.fromObject({
version: "0.2",
phases: {
build: {
commands: ["echo こんにちは"], // "Hello" in Japanese
},
},
}),
});
$ cdk --version
1.63.0 (build 7a68125)
$ cdk deploy stack1 --require-approval=never
stack1: deploying...
<snip>
✅ stack1
$ cdk diff stack1
Stack stack1
Resources
[~] AWS::CodeBuild::Project FooProject FooProject9FE653E4
└─ [~] Source
└─ [~] .BuildSpec:
├─ [-] {
"version": "0.2",
"phases": {
"build": {
"commands": [
"echo ?????"
]
}
}
}
└─ [+] {
"version": "0.2",
"phases": {
"build": {
"commands": [
"echo こんにちは"
]
}
}
}
What did you expect to happen?
cdk diff
reports no diff, when resources are in sync.
What actually happened?
cdk diff
always reports diff, even when resources are in sync.
Environment
- CLI Version : 1.63.0
- Framework Version: 1.63.0
- Node.js Version: v12.18.4
- OS : Linux (Docker container)
- Language (Version): all (I guess…)
Other
Guessing from its behavior, it seems like correct encoding(UTF-8?) is not specified while fetching current template from CloudFormation. So that the non-ASCII characters are converted to the “?” character and treated as if it is having diffs.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:33
- Comments:5 (2 by maintainers)
Top Results From Across the Web
AWS CDK Toolkit (cdk command) - AWS Documentation
The AWS CDK Toolkit, the CLI command cdk , is the primary tool for interacting with ... cdk diff. Compares the specified stack...
Read more >Cloudformation doesn't properly return non-ascii characters
Using the aws-sdk, the http api, the aws cli and the aws cloudformation console, the GetTemplate action does not return non-ascii characters properly...
Read more >What does CDK Diff do in AWS CDK | bobbyhadz
The CDK diff command allows us to compare the deployed and local versions of the CloudFormation templates.
Read more >Lessons in AWS Python CDK: 1-Getting Started
TLDR Install dependencies: Definitely - brew install aws-cdk Maybe: ... (almost always the best way to see if you have something installed).
Read more >Tag Archives: AWS CDK - Noise
There is one default pipeline responsible for deploying resources to the different application environments (e.g., Development, Pre-Prod, and Prod). The code is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Done. https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1220
If anyone is interested in this feature, I recommend opening an issue in Cloudformation coverage roadmap