-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add experimental flag for enabling CDK lookups #235
Conversation
try { | ||
// TODO: support lookups https://github.com/pulumi/pulumi-cdk/issues/184 | ||
await cli.synth({ quiet: true, lookups: false }); | ||
await cli.synth({ quiet: true, lookups }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine assuming we document that folks cannot add pulumi resources in their stacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a commit here that documents how this would work. Pretty much all apps will have pulumi resources due to the asset stuff.
} catch (e: any) { | ||
if (typeof e.message === 'string' && e.message.includes('Context lookups have been disabled')) { | ||
const message = e.message as string; | ||
const messageParts = message.split('Context lookups have been disabled. '); | ||
const missingParts = messageParts[1].split('Missing context keys: '); | ||
throw new Error( | ||
'Context lookups have been disabled. Make sure all necessary context is already in "cdk.context.json". \n' + | ||
'Context lookups have been disabled. Make sure all necessary context is already in "cdk.context.json". ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this look like for an app with multiple stacks (or multiple apps) in one repo? Does "cdk.context.json" contain the context for all of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes cdk.context.json
contains context for the entire app. It's currently not possible to have multiple apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks!
This PR has been shipped in release v1.0.0. |
This adds a new environment variable flag
PULUMI_CDK_EXPERIMENTAL_LOOKUPS
that enables CDK lookups during preview operations.I am working on adding the documentation in a follow up PR #234
re #184