Configuration
Standard CDK rules apply but, we have some added prerequisites, recommendations, and caveats.
Contents
Prerequisites
CDK must be a dev dependency of the module (e.g.
npm install --save-dev aws-cdk
)
We strongly recommend you commit the package-lock.json that is generated after running npm install
.
Recommendations
Feature Flags
The AWS CDK uses feature flags to enable potentially breaking behaviors prior to the next major release that makes them default behaviors.
Flags are stored as Runtime context values in cdk.json
(or ~/.cdk.json
).
aws-cdk:enableDiffNoFail
This feature flag is available in version ^1.0.0
.
If this is set to true
(recommend), cdk diff
will always exit with 0
.
With this set to false
, cdk diff
will exit with a non-zero exit code if there is a diff.
This will result in Runway exiting before all stacks/modules/deployments are processed.
Example
{
"context": {
"aws-cdk:enableDiffNoFail": true
},
}
Environments
Unlike some other module types, CDK does not have a file that can be used to configure an environment.
It can only be configured using the deployment.environments
/module.environments
field.
Example
deployments:
- modules:
- path: mycdkmodule.cdl
environments:
dev: true
prod: true
- modules:
- path: myothercdkmodule.cdk
environments:
dev: true
prod: true
Options
- build_steps: Optional[List[str]] = None
Shell commands to be run before processing the module.
See Build Steps for more details.
Example
options: build_steps: - npx tsc
- skip_npm_ci: bool = False
Skip running
npm ci
in the module directory prior to processing the module. See Disable NPM CI for more details.Example
options: skip_npm_ci: true