Skip to content

Commit

Permalink
docs: note that cdk.context.json must be committed
Browse files Browse the repository at this point in the history
Many people don't commit or want to commit `cdk.context.json`, and
are subsequently annoyed that they can't use `Vpc.fromLookup()` in a
pipeline.

Make it very clear that this is the way CDK is designed to work and
they must do it.
  • Loading branch information
rix0rrr committed Jan 18, 2021
1 parent 491ce7a commit 756a749
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ otherwise. Subnet names will be determined from the `aws-cdk:subnet-name` tag
on the subnet if it exists, or will mirror the subnet type otherwise (i.e.
a public subnet will have the name `"Public"`).

The result of the `Vpc.fromLookup()` operation will be written to a file
called `cdk.context.json`. You must commit this file to source control so
that the lookup values are available in non-privileged environments such
as CI build steps, and to ensure your template builds are repeatable.

Here's how `Vpc.fromLookup()` can be used:

[importing existing VPCs](test/integ.import-default-vpc.lit.ts)
Expand Down

0 comments on commit 756a749

Please sign in to comment.