Skip to content
upload-cloud

GitHub Action

Run aws-cdk

v4.2.0 Latest version

Run aws-cdk

upload-cloud

Run aws-cdk

Run aws-cdk commands

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Run aws-cdk

uses: tj-actions/[email protected]

Learn more about this action in tj-actions/aws-cdk

Choose a version

Ubuntu Mac OS Windows Public workflows that use this action.

CI Update release version.

All Contributors

aws-cdk

Run aws cdk commands.

Features

  • Run aws-cdk with support for downloading the package or running a pre-installed version. (Note: This requires passing the correct value for the working_dir input).
  • Waits for pending stack UPDATE_COMPLETE before running new deployments.

Usage

...
    steps:
      - uses: actions/checkout@v4
        ...
     
      - name: Install dependencies
        ...

      - name: cdk bootstrap
        uses: tj-actions/aws-cdk@v4
        with:
          cdk_subcommand: "bootstrap"
          cdk_stack: "stack1"
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: "us-east-1"

      - name: cdk diff
        uses: tj-actions/aws-cdk@v4
        with:
          cdk_subcommand: "diff"
          cdk_stack: "stack1"
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: "us-east-1"

      - name: cdk synth
        uses: tj-actions/aws-cdk@v4
        with:
          cdk_subcommand: "synth"
          cdk_stack: "stack1"
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: "us-east-1"

      - name: cdk deploy
        uses: tj-actions/aws-cdk@v4
        with:
          cdk_subcommand: "deploy"
          cdk_stack: "stack1"
          cdk_extra_args: >-
            --progress events
            --require-approval never
            --parameters environment=${{ secrets.ENVIRONMENT }}
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: "us-east-1"

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
cdk_extra_args string false AWS CDK subcommand arguments.
cdk_stack string false "*" AWS CDK stack name to
execute.
cdk_subcommand string true AWS CDK subcommand to execute.
cdk_version string false "latest" AWS CDK version to install.
working_dir string false "." Working directory.

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Credits

This package was created with Cookiecutter using cookiecutter-action

Report Bugs

Report bugs at https://github.com/tj-actions/aws-cdk/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Raphael Boidol
Raphael Boidol

📖

This project follows the all-contributors specification. Contributions of any kind welcome!