A library to define environment-specific settings for AWS CDK using cdk.json
yarn add --dev aws-cdk-config
{
[...]
context: {
"updateFrequencyMinutes": {
"dev": 15,
"prod": 5
},
"dnsEntries": {
"dev": {
"baseName": "domain.dev",
},
"prod": {
"baseName": "domain.com",
}
},
"projectName": "myProject"
[...]
}
}
import { Config } from "aws-cdk-config";
import { App } from "aws-cdk-lib";
const app = new App();
const config = new Config(app);
config.getEnvParam("updateFrequencyMinutes"); //Will vary based on being dev, prod, etc.
config.getEnvParam("dnsEntries").baseName; //Will vary based on being dev, prod, etc.
config.getParam("projectName"); //Will be the same across all environments