Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mob-on/aws-cdk-config
A simple library to manage environment-specific AWS CDK config
https://github.com/mob-on/aws-cdk-config
Last synced: about 1 month ago
JSON representation
A simple library to manage environment-specific AWS CDK config
- Host: GitHub
- URL: https://github.com/mob-on/aws-cdk-config
- Owner: mob-on
- Created: 2023-01-13T09:24:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-01-13T14:03:10.000Z (over 1 year ago)
- Last Synced: 2024-08-07T20:16:45.476Z (about 2 months ago)
- Language: TypeScript
- Size: 1.13 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple AWS Config
A library to define environment-specific settings for AWS CDK using cdk.json
## Install
`yarn add --dev aws-cdk-config`
## Usage
### cdk.json format:
```
{
[...]
context: {
"updateFrequencyMinutes": {
"dev": 15,
"prod": 5
},
"dnsEntries": {
"dev": {
"baseName": "domain.dev",
},
"prod": {
"baseName": "domain.com",
}
},
"projectName": "myProject"
[...]
}
}
```### Setting up the config in your app entrypoint:
```
import { Config } from "aws-cdk-config";
import { App } from "aws-cdk-lib";const app = new App();
const config = new Config(app);
```### Retrieving values from config:
```
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
```