aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
API: GetTemplate/DescribeStacks do not properly return utf-8 characters
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
Not a template bug report per se, but I need a public place to report this bug to you so that I can refer to it from the AWS CDK project. Originally reported here: https://github.com/aws/aws-cdk/issues/13634
The bug is that if we submit a template with non-ASCII characters, CloudFormation properly executes it, but it will break the non-ASCII characters when reading them back through the API (`GetTemplate`, `DescribeStacks`). This causes the AWS CDK to always detect changes when a template contains Unicode characters, because the template will contain `請交月報` whereas the template returned by CloudFormation will contain `????`.
**It is impossible to build correct automation on top of this API behavior**
## Reproduction
Deploy the following template:
```
Resources:
MyTopic:
Type: AWS::SNS::Topic
Properties:
DisplayName: 請交月報
Outputs:
ChineseOutput:
Value: 請交月報
```
Then look at the template or look at the outputs:
```
$ aws cloudformation get-template --stack-name TestStack
{
/* See the question marks that have appeared in the next line */
"TemplateBody": "Resources:\n MyTopic:\n Type: AWS::SNS::Topic\n Properties:\n DisplayName: ????\nOutputs:\n ChineseOutput:\n Value: ????\n",
"StagesAvailable": [
"Original",
"Processed"
]
}
$ aws cloudformation describe-stacks --stack-name TestStack
{
"Stacks": [
{
...
"Outputs": [
{
"OutputKey": "ChineseOutput",
"OutputValue": "????"
}
],
}
]
}
```
The Topic does actually get created with the correct name, so the problem does not happen at ingestion but between execution and returning values:

Contributor guide
Research direction
Start by reproducing the behavior with the AWS CLI commands shown for GetTemplate and DescribeStacks, using the provided template containing 請交月報. Done means the deployed template and stack output preserve the original non-ASCII characters when returned by both APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100