-
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
Vpc.from_lookup in v0.36 (python): Cannot retrieve value from context provider vpc-provider since account/region are not specified at the stack level #3082
Comments
We should update the error message so that it's clear how to resolve this. |
I also got this error for the new route53.HostedZone.fromLookup when trying to update the static-site example for v0.36. I'm specifying the region in the stack env, but it seems I also have to provide a concrete account ID? Are there other ways out of this error? The docs seem to suggest I should be able to make this template "relocatable" and usable by others, but specifying a concrete account ID makes that difficult. |
Having the same issue with 0.36 trying to lookup an existing vpc. |
I'm having the same issue. I was able to fix it by having my stacks environment configured with an account and region. I don't know how it knew which account and region to fetch the default VPC from before updating to 0.36.0 |
@fulghum would be great to see the proper message in this thread as well |
Same issue with
The verbose of cdk synth is as follows.
I am using TypeScript here. |
to fix this error, you have to add |
@pagameba is there another way? Hard coding account id does not seem like a good idea. |
I'm having a similar issue: 3130 |
@xelibrion I'm just getting started with CDK, but I believe that this should be picked up by CDK from your account credentials and isn't due to a bug - my suggestion was just a work-around. @mrcustard sounds like #3130 is the same symptom I faced, this was my work-around so I could keep moving forward. |
This is the expected behavior >= 0.36.0. We wanted to reduce the implicit effect the user's environment has on the synthesis result as this can cause production risks, so we made this explicit. If you don't specify DeploymentStack(
app=app,
id='Dev',
env={
'account': os.environ['CDK_DEFAULT_ACCOUNT'],
'region': os.environ['CDK_DEFAULT_REGION']
}
) |
@eladb I am still facing this issue even after providing the |
I'm submitting a ...
What is the current behavior?
Upgraded to 0.36.0 (build 6d38487).
Problems with Vpc.from_lookup().. stack class code at the bottom. Snippet here:
Running
cdk synth
results in error:Expected cdk synth to work with no errors. It worked with earlier cdk releases.
Did 0.36 introduce new dependencies for vpc context provider?
What does the msg mean:
Please tell us about your environment:
Stack code:
The text was updated successfully, but these errors were encountered: