Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
93

aws-cdk aws-cdk

Integration with AWS Cloud Development Kit.

arguments

  • AWS_ACCESS_KEY_ID - Amazon access key ID
  • AWS_DEFAULT_REGION - AWS region. Default is us-east-1
  • AWS_SECRET_ACCESS_KEY - Amazon secret key (make sure it's encrypted)
  • action - The CDK operation to execute. Value can be synth, bootstrap, deploy, diff, list, destroy, freestyle
  • cdk_version - Version of AWS CDK. The matching image needs to exist
  • cmd_ps - Additional flags to pass to the aws cdk command
  • commands - Commands to execute in plugin container for `freestyle` action)
  • debug - a hidden option show more debug info
  • language - The language of the application. Default is typescript
  • project_dir - the path where the CDK application is located
  • stacks - a comma-separated list of stacks
  • verbose - Add the --verbose flag to the commands if true. Default is true

returns

  • CDK_OUT_DIR_PATH - The path in the Codefresh Volume to the template saved as the cdk.out JSON file.
  • STATUS - exit code. 0 indicates success
  • STATUS_JSON_FILE - The path in the Codefresh Volume to the JSON answer from the ACTION performed.
    AwsCDKDeploy:
  title: Deploy the CDK application
  type: aws-cdk
  stage: deploy
  working_directory: '${{gitClone}}/cdk/lambda-cron'
  arguments:
    action: deploy
    language: TypeScript
    cdk_version: 1.94.1
    AWS_ACCESS_KEY_ID: '${{AWS_ACCESS_KEY_ID}}'
    AWS_SECRET_ACCESS_KEY: '${{AWS_SECRET_ACCESS_KEY}}'
    AWS_SESSION_TOKEN: '${{AWS_SESSION_TOKEN}}'
    AWS_DEFAULT_REGION: us-east-1a

  
github.com
Francisco Cocozza, Laurent Rochette, Lukas Goodfellow
Apr 9, 2021