aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

GetTemplate API does not support non-ASCII characters #1220

Open idm-ryou opened 2 years ago

idm-ryou commented 2 years ago

Name of the resource

Other

Resource Name

CloudFormation GetTemplate API

Issue Description

When the GetTemplate API is executed against a stack of templates containing non-ASCII characters, such as Japanese characters, the non-ASCII characters in the template are converted to question marks.

This makes it impossible to properly understand the contents of the template after deployment, and also makes it impossible for tools such as AWS CDK to properly display the diff of the template. https://github.com/aws/aws-cdk/issues/10523

This is a big problem for non-English speakers, who often include native language descriptions and logs in their templates. This is also expected to be a problem for English speakers when specifying emojis.

Expected Behavior

Given

Deployed as SampleStack

Resources:
  MySNS:
    Type: AWS::SNS::Topic
    Properties: 
      DisplayName: Helloこんにちは☺

When

$  aws cloudformation get-template --stack-name SampleStack

Expected

{
    "TemplateBody": "Resources:\r\n  MySNS:\r\n    Type: AWS::SNS::Topic\r\n    Properties: \r\n      DisplayName: Helloこんにちは☺\r\n",
    "StagesAvailable": [
        "Original",
        "Processed"
    ]
}

Observed Behavior

Actual

{
    "TemplateBody": "Resources:\r\n  MySNS:\r\n    Type: AWS::SNS::Topic\r\n    Properties: \r\n      DisplayName: Hello??????\r\n",
    "StagesAvailable": [
        "Original",
        "Processed"
    ]
}

Test Cases

Deploy a CloudFormation template that contains non-ASCII characters and call the GetTemplate API to see if the same content is returned as the template.

Other Details

azatoth commented 2 years ago

@AidenAtSea I have problem to see how this can be seen as an enhancement and not as a bug. Could you expand on the rationale for this relabeling?

kewur commented 2 years ago

related:

https://github.com/aws/aws-cdk/issues/10523 https://github.com/aws/aws-cdk/issues/20212

I agree that this is a bug and not an enhancement

tmokmss commented 2 months ago

This is now becoming a big problem because in Agents for Bedrock, it is very common to include non-ASCII characters as instruction or tools description of an agent (e.g. CJK languages; users want to define an agent with their native languages) in CloudFormation template (doc), and this issue makes CFn change set does not work properly. Even properties are unchanged, CFn changeset regards them as diffs, thereby making CDK diff unusable.