Skip to content

fix(amplify): custom domain with blank prefix causes stack drift#37325

Closed
syukawa-gh wants to merge 2 commits intoaws:mainfrom
syukawa-gh:fix/amplify-domain-blank-prefix-clean
Closed

fix(amplify): custom domain with blank prefix causes stack drift#37325
syukawa-gh wants to merge 2 commits intoaws:mainfrom
syukawa-gh:fix/amplify-domain-blank-prefix-clean

Conversation

@syukawa-gh
Copy link
Copy Markdown
Contributor

When a subdomain is mapped with an empty string prefix, the CloudFormation template includes Prefix: "" but AWS omits empty prefix values, causing immediate stack drift after deployment.

Now omit the prefix property entirely when it is an empty string.

Closes #35958

When a subdomain is mapped with an empty string prefix, the
CloudFormation template includes 'Prefix: ""' but AWS omits
empty prefix values, causing immediate stack drift. Now omit
the prefix property entirely when it is an empty string.

Closes aws#35958
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Mar 23, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 23, 2026 09:38
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Exemption Request: This PR fixes a stack drift issue by omitting empty prefix from CloudFormation template. Unit test has been added. Integration test would require an actual Amplify app with a custom domain, which is not practical for automated testing.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Mar 24, 2026
@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Closing this PR. After further investigation, the prefix property is required in the CFn SubDomainSettingProperty schema, so omitting it causes a synthesis validation error. The stack drift issue (#35958) is caused by CloudFormation's behavior of omitting empty string values in drift detection, which cannot be fixed on the CDK side.

@syukawa-gh syukawa-gh closed this Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-amplify-alpha): Custom domain with blank prefix causes stack drift

3 participants