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
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
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
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:
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