Note, I prefer the node --require option of loading .env variables over importing or requiring in application code. TLDR; install dotenv as a development dependency in the cdk.json in the root of the project directory add the following in bold : { "app": "npx ts-node -r dotenv/config --prefer-ts-exts bin/<stack-name>.ts" } When developing via AWS CDK it is easy to set environment …
Continue reading "Using AWS CDK with dotenv -r and TypeScript"
