AWS CDK #
CDK Construct library #
Disable CDK analytics (metadata reporting) #
In cdk.json file
{
"app": "npx…",
"versionReporting": false
}
CDK Workshop #
Intro/best practices #
- Opinionated set of tips and best practices by Kevin Lin
- A collection of awesome things related to the CDK by Rajkumar Kalaiselvam
Naming conventions #
-
Stack ids
ExamplemyOrg-myApp-prod
Use a fully qualified naming scheme, this value will be prepended to all constructs created inside the stack
syntax:{org}-{app}-{stage}
-
Construct Ids
Example:QryParamsCachePolicy
- Use PascalCase with no spaces, punctuation or underscores
- Append type to the suffix
- Every AWS service has different naming restrictions so its best to use a compatible default naming scheme
To bundle only the assets of the requested stack #
Pass the exclusively argument to the cli
cdk deploy MyStack --exclusively
OR
cdk deploy MyStack -e
cdk.json reference #
https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-config