Skip to content
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

Message from CloudFormation about DNS zone mapping not using lazy: true. #31918

Closed
1 task
nomike opened this issue Oct 28, 2024 · 2 comments
Closed
1 task
Assignees
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@nomike
Copy link

nomike commented Oct 28, 2024

Describe the bug

Using this python class and these
parameters results in this
synthesized CloudFormation script.

The noteworthy parts are:

        HostedZoneId:
          Fn::FindInMap:
            - MappingCopyAWSCloudFrontPartitionHostedZoneIdMapc88b0307188360f6083c72a2a857503f8678fb10e7
            - Ref: AWS::Partition
            - zoneId

and

Mappings:
  MappingCopyAWSCloudFrontPartitionHostedZoneIdMapc88b0307188360f6083c72a2a857503f8678fb10e7:
    aws:
      zoneId: Z2FDTNDATAQYW2
    aws-cn:
      zoneId: Z3RFFRIM2A3IF5

According to this CloudFormation user guide, alias records pointing to CloudFront distributions need to use Z2FDTNDATAQYW2 as a hosted zone ID. From the variable naming I assume the mapping is included for a china specific workaround.

The problem with this is that it leads to the following message from CloudFormation:

[Info at /use1-pr-customer-api-public-route53-aliasrecord/MappingCopy-AWSCloudFrontPartitionHostedZoneIdMap-c88b0307188360f6083c72a2a857503f8678fb10e7] Consider making this CfnMapping a lazy mapping by providing `lazy: true`: either no findInMap was called or every findInMap could be immediately resolved without using Fn::FindInMap

Normally it would be clear what to do, but as the affected code is auto-generated and not written by me, it is not possible for me to provide that flag.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I would either expect CDK to provide lazy: true or at least the message not to be shown. As there is nothing I can do to get rid of it the message is just spam and doesn't help me at all.

Current Behavior

CloudFormation shows the message I quoted above and there is nothing that can be done about it.

Reproduction Steps

Create two stacks in different regions. Once defining a CloudFront distribution and the other defining a route53 alias record pointing to that distribution.

Possible Solution

It should be evaluated whether providing the lazy: true option would have any negative side effects and if not, it should just be added.

If it's not possible to add this, a more sophisticated approach might be needed.

Additional Information/Context

No response

CDK CLI Version

2.164.1 (build bb9275c)

Framework Version

No response

Node.js Version

v20.5.1

OS

Ubuntu 24.04 LTS

Language

Python

Language Version

Does not apply

Other information

No response

@nomike nomike added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Oct 28, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-reproduction This issue needs reproduction. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2024
@khushail khushail self-assigned this Oct 28, 2024
@khushail
Copy link
Contributor

Hey @nomike , thanks for reaching out. Kindly Request you to provide a self contained minimum code repro for this issue.

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 28, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 31, 2024
@github-actions github-actions bot added closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 5, 2024
@github-actions github-actions bot closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants