Table of Contents
- create a env file for python
- read from env values in your cdk code
Creating a env file in python
Creating a .env file in python is easy, in the root directory of the cdk project we can use the command
vi .env
we need to make sure that it’s in root directory and to really make python use it, we need to import it in requirements.txt and then import the library in python cdk
Lets look at a sample cdk applications, where we use the .env file to dynamically use key value pairs in the cdk, for example – name of the vpc, subnets range etc or environment prefixes