HostedZone: Default period at the end should be optional #22406
Labels
@aws-cdk/aws-route53
Related to Amazon Route 53
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
In the HostedZone constructor, a period is added to the end of the name on line 163.
This changes the user's input from
github.com
togithub.com.
. Although Route53 considers these to be identical, they cannot co-exist together. Thus, for anybody moving from CFN templates to CDK, who did not have a.
at the end of their name, this line breaks their CloudFormation deployment.Consider a user who has a CloudFormation template with the following:
Who then re-creates their resource in CDK, keeping the same LogicalId for the migration
Because the
.
is added, CloudFormation will see this as a name change, and try to re-create the resource. However, Route53 will see the same domain name and block the creation because the domain already exists. Because this added.
is by default, the user is only left with hacky solutions to deploy their code.Expected Behavior
Give the user an option whether or not the
.
should be added at the endCurrent Behavior
The user has no control over the behavior.
Reproduction Steps
Create a hosted zone with a CFN template with no trailing
.
, and then try to create the same HostedZone, with the LogicalId overwritten, using CDK.Possible Solution
At this point, I believe the only viable solution is a flag (
addTrailingDot
?) added to the properties which is defaulted to true. Unfortunately, removing this behavior outright will break anybody's code who didn't have pre-existing resources.If
github.com.
exists in a user's Route53 domain list, and the.
is removed from a later release of this package, then their CDK will start deploying asgithub.com
, which will still cause CloudFormation to try to re-create the resource, causing the same issue.Additional Information/Context
No response
CDK CLI Version
2.43.1
Framework Version
No response
Node.js Version
14
OS
Mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: