Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```