This simple project was inspired from this stackoverflow question, where I shared this answer.
When I read docs on the AppConfig construct library, I soon realized that it was ripe for L2 and L3 constructs. Hence this library.
PRs are always welcome !
- A more customizable construct allowing consumers for a deeper configuration.
- Add support for semantic validation.
Language | Repository |
---|---|
JavaScript/TypeScript | cdk-appconfig |
"dependencies": {
...
"cdk-appconfig": "*", // choose specific version
...
},
import { StackProps, Stack, App } from 'aws-cdk-lib';
import { SimpleAppConfig } from 'cdk-appconfig';
import { Construct } from 'constructs';
/**
* Demo stack for {@link SimpleAppConfig}.
*/
export class SimpleAppConfigDemoStack extends Stack {
/**
* The {@link SimpleAppConfig} construct.
*/
public readonly simpleAppConfig: SimpleAppConfig;
constructor(scope: Construct, id: string, props: StackProps = {}) {
super(scope, id, props);
// Everything below is customizable, so use it as needed.
this.simpleAppConfig = new SimpleAppConfig(this, 'SimpleAppConfig', {
applicationName: 'MyAppConfigAppName',
applicationEnvironment: 'MyEnvironment',
configurationProfileName: 'MyConfigProfileName',
// see {@link SimpleAppConfig#ConfigurationContent}, this is pretty generic.
configurationContent: {
MyStringKey: 'MyValue',
MyBooleanKey: true,
MyNumberKey: 123,
MyCompositeKey: {
MyStringKey: 'MyValue',
MyBooleanKey: true,
MyNumberKey: 123,
},
MyArrayKey: [
{
MyStringKey: 'MyValue1',
MyBooleanKey: true,
MyNumberKey: 123,
},
{
MyStringKey: 'MyValue2',
MyBooleanKey: false,
MyNumberKey: 456,
},
],
},
});
}
}