aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

API: GetTemplate/DescribeStacks do not properly return utf-8 characters

Open
#814 0 comments 23 reactions 0 assignees View on GitHub
Coverage enhancement
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:

![image](https://user-images.githubusercontent.com/524162/111452399-c4738c00-8712-11eb-803d-575bad3ccc46.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.