From 770f2681e489b8adf12a76d08ac29871bf448d77 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 18 Jan 2021 11:03:11 +0100 Subject: [PATCH] docs: note that `cdk.context.json` must be committed (#12565) 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. Relates to #12160 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ec2/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/@aws-cdk/aws-ec2/README.md b/packages/@aws-cdk/aws-ec2/README.md index b8a583d1a2ea5..69d125fb4939e 100644 --- a/packages/@aws-cdk/aws-ec2/README.md +++ b/packages/@aws-cdk/aws-ec2/README.md @@ -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)