-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_apigatewayv2: DomainName.name is no longer passed as value to ARecord #16829
Comments
Oh yeah, ensuring proper dependency ordering is definitely important... Would it make sense for the |
Hi, Thanks for filing this bug. Unfortunately, we had to change this from a value to a reference. Changing this back would break a few more users who are now depending on the new 'Depends On' behavior. Instead, I suggest not using |
Instead of changing it back to value from a reference, would it be hard for the |
@ppena-LiveData - Since the value is a CloudFormation @njlynch - correct me if my statement is incorrect. |
Yes, and no. The utility function that processes the given domain name doesn't do any special-casing or handling of Tokens. We could simply take Tokens at their face value, but that may be prone to introducing errors, as the domain name must be a fully-qualified domain name, including trailing The somewhat unintended side-effect is that the function checks for the trailing aws-cdk/packages/@aws-cdk/aws-route53/lib/util.ts Lines 53 to 54 in c6db91e
This means if you suffix your domain name (e.g,. |
@njlynch - even if the function did handle the token case correctly, since the token resolves to a CloudFormation Ref, it would still not be able to check if the domain name includes the hosted zone. Not until during deployment, no? |
Correct. We'd need to define behavior such that the Token is just absolutely trusted (as I mentioned above, potentially error-prone), or build something as complex as a custom resource to validate. |
@ppena-LiveData - looks like this is not achievable trivially. As suggested above, the best option is to pass the domain name directly rather than reference it via |
|
What is the problem?
We used to be able to create a
route53.ARecord
with arecordName
referencing anapigw2.DomainName.name
, but that stopped working after CDK version 1.123.0 (I haven't tested 1.124.0 and 1.125.0, but it definitely stopped working in 1.126.0).The problem is that
apigw2.DomainName.name
used to be passed as a value, so theroute53.ARecord
code could tell that the domain name was a subdomain of the Hosted Zone name, but now that the name is passed as a reference, it can't, so instead of the ARecord being forsubdomain.hosted.zone.com
, it does it forsubdomain.hosted.zone.com.hosted.zone.com
.Reproduction Steps
What did you expect to happen?
Both
OutputDomainName
andOutputDnsAlias
should both have the same value.What actually happened?
Instead of
subdomain.hosted.zone.com
, the ARecord's domain name issubdomain.hosted.zone.com.hosted.zone.com
.CDK CLI Version
1.126.0 (build f004e1a)
Framework Version
No response
Node.js Version
v14.16.0
OS
Windows
Language
Python
Language Version
Python 3.9.6
Other information
No response
The text was updated successfully, but these errors were encountered: