Examining CDK deployment logs
Another way to troubleshoot a CDK application is by looking at its internal logs. This is often useful if a certain resource gets stuck when being created, which, for example, happens when an ECS container fails to stabilize. In such situations, looking at the verbose CDK logs could shine a light on what is happening.
This can be achieved by passing the following flags to cdk
commands:
-
v
: Verbose-vv
: Very verbose-vvv
: Extremely verbose
For instance, when deploying using cdk deploy
, you can see a lot more information about the status of the deployment if you pass in one of the aforementioned flags, like so:
$ cdk deploy --profile cdk -vv
There is also the -debug
flag. The -debug
flag is used to enable debug mode for the cdk
command. It will cause the CDK to display additional debug information about the deployment process, including detailed information about the CloudFormation stack events and the individual AWS SDK calls...