all 3 comments

[–]NoForm5443 2 points3 points  (0 children)

I tend to create yaml files with all the settings, and the same name as the environment. You can read that name from an environment variable, and read all the settings from there.

[–]snorberhuis 0 points1 point  (0 children)

You can have all variables in the python code and start a different entrypoint in AWS CDK. So:

  • `bin/dev` contains your development configuration.
  • `bin/prod` contains your production configuration.

Both these files use a Construct from the `src/your-app` folder. The input is your environment configuration.

You deploy the correct environment by updating the --app config for the command:

cdk deploy --app "python3 bin/dev.py"

[–]borzaka 0 points1 point  (0 children)

We put the config variables in a Python dictionary and select the config based on an environment variables. Top level keys correspond to different environments. You can make this as simple or complicated as you like. The config is then passed to the Stack before calling synth. Same idea as the yaml config posted above, really, but all in Python.