aws / aws/aws-cdk

core/SES: Email template unicode support is broken

Open
#33,285 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ses bug needs-cfn p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

I run into the issue on using CDK import of `aws_ses.CfnTemplate` resource. Imported email templates into a CDK stack I've started to get errors on each following `cdk import` run reporting that email templates has been modified and cdk cannot do import on modified stacks.

Meanwhile not CDK diff nor drift detection report any difference.

I've tried to perform a modification in a template and got that little modification will rewrite all the fields in the template. Also server side template is looking like all unicode characters was replaced with question marks (`?`).

Removing all unicode symbols from email template fixes the issue.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Version

_No response_

### Expected Behavior

```
Resources
[~] AWS::SES::Template SesEmailTemplates/UnicodeTestTemplate SesEmailTemplatesUnicodeTestTemplateB22B733D may be replaced
└─ [~] Template (may cause replacement)
└─ [~] .SubjectPart:
├─ [-] Unicode ® char.
└─ [+] Unicode ® char
```

### Current Behavior

```
Resources
[~] AWS::SES::Template SesEmailTemplates/UnicodeTestTemplate SesEmailTemplatesUnicodeTestTemplateB22B733D may be replaced
└─ [~] Template (may cause replacement)
├─ [~] .HtmlPart:
│ ├─ [-] Unicode ? char.
│ └─ [+] Unicode ® char.
├─ [~] .SubjectPart:
│ ├─ [-] Unicode ? char.
│ └─ [+] Unicode ® char.
└─ [~] .TextPart:
├─ [-] Unicode ? char.
└─ [+] Unicode ® char
```

### Reproduction Steps

1. Deploy this construct in a stack.
```typescript
new ses.CfnTemplate(
this,
"UnicodeTestTemplate",
{

template: {
templateName: "UnicodeTestTemplate",
subjectPart: "Unicode ® char.",
textPart: "Unicode ® char.",
htmlPart: "Unicode ® char.",

},
}
);
```
The result is good and diff is empty after deploy.

2. Update one field in the template, like remove point from `subjectPart`.
3. Run `cdk diff` (I've also tried `cdk diff --strict`, result is the same) and look at the result.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.177.0

### Framework Version

_No response_

### Node.js Version

22.13.1

### OS

Arch Linux

### Language

TypeScript

### Language Version

5.6.3

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

The entry point is the aws_ses.CfnTemplate construct and the cdk diff/import workflow described in the reproduction. First reproduce the issue with the TypeScript snippet using the ® character, then trace how SES template fields are read and compared. Done means Unicode remains intact and repeated import or diff no longer reports a change after an unrelated template edit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.