question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HostedZone.fromlookup not working in nested stacks

See original GitHub issue

When using HostedZone.fromLookUp in a nested stack is not able to find out the hostedzone and keeps the DUMMY id value. Also it does not creates the entry in the context file.

Reproduction Steps

Create a hosted zone in route 53. Then create a stack, inside this stack create a nested stack that just gets a zone based in a domain name:

const zone = HostedZone.fromLookup(this, `zoneId`, {
      domainName: domain
    });

Error Log

No hosted zone found with ID: DUMMY (Service: AmazonRoute53; Status Code: 404; Error Code: NoSuchHostedZone; Request ID: 9868b6a0-6109-48e6-b475-c31c6041778f)

Environment

  • CLI Version : v.1.12.0
  • Framework Version: v.1.12.0
  • OS : mac
  • Language : Typescript

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
flashflexprocommented, Nov 2, 2020

I figured it out, you need to add cdk.context.json into repo to give CloudFormationCreateUpdateStackAction the context to load host zone.

On Fri, Oct 30, 2020 at 7:58 PM Ilia luk notifications@github.com wrote:

anyone managed to work around this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aws/aws-cdk/issues/4651#issuecomment-719849857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVPH4LGMFH4N53CYNEJW73SNNHKRANCNFSM4JEG4A7Q .

2reactions
gyang-vonagecommented, Oct 21, 2020

Still happening, can be avoided with command “cdk deploy”, only happens when using CloudFormationCreateUpdateStackAction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class HostedZone (construct) · AWS CDK
Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack. static fromLookup(scope, id, query), Lookup a...
Read more >
How to create hosted zone in AWS CDK? - Stack Overflow
This worked for me. hostedZone = route.HostedZone.from_hosted_zone_attributes(self, 'HostedZone', hosted_zone_id='some id ', zone_name='zone ...
Read more >
awslabs/aws-cdk - Gitter
Anyone having issues with UpdatePipeline and SelfMutate being stuck in a loop when using CDK.Pipelines? I can't seem to find a workaround.
Read more >
Using Nested Stacks with AWS CDK - DEV Community ‍ ‍
A basic example of how Nested Stacks work in AWS CDK. Do not forget to destroy this stack after you're done via: yarn...
Read more >
CDK context and Environment | Keep bragging - Technologies
The AWS CDK supports context methods that allow AWS CDK apps to get contextual information. HostedZone.fromLookup: Gets the hosted zones in your account....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found