You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add --no-lookups flag to disable context lookups
Context lookups are supposed to be performed on developer desktops, and
committed to `cdk.context.json`. If you don't, your CI build might try
to perform a lookup and fail with an unclear error message about
permissions, or worse: appear to work properly but leave you with a
nondeterministic build.
Introduce a CLI flag called `--no-lookups` that throws an appropriately
descriptive error message if you forgot to perform context lookups
before committing.
This now also makes it possible to write an integration test for
PR #11461.
Copy file name to clipboardexpand all lines: packages/aws-cdk/bin/cdk.ts
+1
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ async function parseCommandLineArguments() {
46
46
.option('plugin',{type: 'array',alias: 'p',desc: 'Name or path of a node package that extend the CDK features. Can be specified multiple times',nargs: 1})
47
47
.option('trace',{type: 'boolean',desc: 'Print trace for stack warnings'})
48
48
.option('strict',{type: 'boolean',desc: 'Do not construct stacks with warnings'})
49
+
.option('lookups',{type: 'boolean',desc: 'Perform context lookups (synthesis fails if this is disabled and context lookups need to be performed)',default: true})
49
50
.option('ignore-errors',{type: 'boolean',default: false,desc: 'Ignores synthesis errors, which will likely produce an invalid output'})
50
51
.option('json',{type: 'boolean',alias: 'j',desc: 'Use JSON output instead of YAML when templates are printed to STDOUT',default: false})
51
52
.option('verbose',{type: 'boolean',alias: 'v',desc: 'Show debug logs (specify multiple times to increase verbosity)',default: false})
+'Make sure all necessary context is already in \'cdk.context.json\' by running \'cdk synth\' on a machine with sufficient AWS credentials and committing the result. '
0 commit comments