AWS CDK

AWS CDK #

CDK Construct library #

Construct Hub

Disable CDK analytics (metadata reporting) #

In cdk.json file

{
"app": "npx…",
"versionReporting": false
}

CDK Workshop #

https://cdkworkshop.com/

Intro/best practices #

Naming conventions #

  • Stack ids
    Example myOrg-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

Best practices for multiple developers working on the same CDK app #

Have a Stack instance per deployed stack by by Adam Ruka