-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-amplify-alpha): Custom domain with blank prefix causes stack drift #35958
Copy link
Copy link
Open
Labels
@aws-cdk/aws-amplifyRelated to AWS AmplifyRelated to AWS AmplifybugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Describe the bug
After deploying a CDK stack containing an Amplify app with a custom domain that has a blank prefix, the underlying CloudFormation stack is immediately in "drifted" state.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
The underlying CloudFormation stack should not be drifted.
Current Behavior
The stack is in drifted state after deployment:
Expected:
{
"SubDomainSettings": [
{
"BranchName": "master",
"Prefix": ""
}
],
"AppId": "xxxyyyzzz",
"AutoSubDomainIAMRole": "arn:aws:iam::xxxyyyzzz",
"DomainName": "mysubdomain.mydomain.com",
"EnableAutoSubDomain": false,
"AutoSubDomainCreationPatterns": [
"*",
"pr*"
]
}Actual:
{
"SubDomainSettings": [
{
"BranchName": "master"
}
],
"AppId": "xxxyyyzzz",
"AutoSubDomainIAMRole": "arn:aws:iam::xxxyyyzzz",
"DomainName": "mysubdomain.mydomain.com",
"EnableAutoSubDomain": false,
"AutoSubDomainCreationPatterns": [
"*",
"pr*"
]
}Reproduction Steps
Add a custom domain with a blank prefix like so:
amplify_app.add_domain('AppDomain',
domain_name = 'mysubdomain.mydomain.com',
sub_domains = [amplify.SubDomain(prefix = '', branch = 'master')]
)As specified by the documentation for amplify.SubDomain, we: Use '' to map to the root of the domain.
Possible Solution
No response
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.222.0-alpha.0
AWS CDK CLI version
2.1031.1
Node.js Version
v24.11.0
OS
macOS 15.7.1
Language
Python
Language Version
3.14.0
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-amplifyRelated to AWS AmplifyRelated to AWS AmplifybugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2