Deploying an AWS CDK app with a workflow - Amazon CodeCatalyst

Deploying an AWS CDK app with a workflow

This section describes how to deploy an AWS Cloud Development Kit (AWS CDK) app into your AWS account using a workflow. To accomplish this, you must add the AWS CDK deploy action to your workflow. The AWS CDK deploy action synthesizes and deploys your AWS Cloud Development Kit (AWS CDK) app into AWS. If your app already exists in AWS, the action updates it if necessary.

For general information about writing apps using the AWS CDK, see What is the AWS CDK? in the AWS Cloud Development Kit (AWS CDK) Developer Guide.

When to use the 'AWS CDK deploy' action

Use this action if you have developed an app using the AWS CDK, and you now want to deploy it automatically as part of automated continuous integration and delivery (CI/CD) workflow. For example, you might want to deploy your AWS CDK app automatically whenever someone merges a pull request related to your AWS CDK app source.

How the 'AWS CDK deploy' action works

The AWS CDK deploy works as follows:

  1. At runtime, if you specified version 1.0.12 or earlier of the action, the action downloads the latest CDK CLI (also called the AWS CDK Tookit) to the CodeCatalyst build image.

    If you specified version 1.0.13 or later, the action comes bundled with a specific version of the CDK CLI, so no download occurs.

  2. The action uses the CDK CLI to run the cdk deploy command. This command synthesizes and deploys your AWS CDK app into AWS. For more information about this command, see the AWS CDK Toolkit (cdk command) topic in the AWS Cloud Development Kit (AWS CDK) Developer Guide.

CDK CLI versions used by the "AWS CDK deploy" action

The following table shows which version of the CDK CLI is used by default by different versions of the AWS CDK deploy action.

Note

You might be able to override the default. For more information, see CdkCliVersion in the 'AWS CDK deploy' action YAML.

'AWS CDK deploy' action version AWS CDK CLI version

1.0.0 – 1.0.12

latest

1.0.13 or later

2.99.1

How many stacks can the action deploy?

The AWS CDK deploy can deploy a single stack only. If your AWS CDK app consists of multiple stacks, you must create a parent stack with nested stacks, and deploy the parent using this action.