AttiniCdk

To simplify deployments of AWS CDK Projects Attini provides the AttiniCdk type.

AttiniCdk uses the CDK CLI on an Attini runner job to perform the deployment, so you can optionally configure your own AWS IAM Role and container image. This way your deployment can follow the principle of least privilege and use any software versions you need.

AttiniCdk will register all the CDK stacks with Attini, so that your CDK stacks will be taken into consideration by the attini ops rogue-stacks report.

Because the AttiniCdk uses the CDK CLI to do the deployment, most configuration options will map to a CDK CLI option. If the configuration is omitted, the CDK CLI default behavior will apply, unless otherwise specified in the docs.

Non-default behavior
  1. --require-approval never will be used because the standard approval makes no sense when the deployment isn’t executed from your local workstation. If you want manual approval for changes, please follow this guide.
  2. --progress events will be used.
Type: AttiniCdk
Properties:
    Runner: String
    Path: String
    App: String
    Diff:
        Enabled: Boolean
    Environment: Map<String,String>
    Stacks: List<String>
    Context: Map<String,String>
    Plugins: List<String>
    StackConfiguration: List<CdkParameters>
    Build: String
    BuildExclude: List<String>
    Exclusively: Boolean
    NotificationArns: List<String>
    Force: Boolean
    RoleArn: String

Runner

Type: String

Reference a Attini::Deploy::Runner recourse, find more information here.

Required: No

Path

Type: String

Location of your CDK project directory inside your Attini distribution.

Required: Yes

App

Type: String

This property is passed to the --app option in the CDK CLI.

If your project has a cdk.json file with the "app" property configured, this is not needed.

Required: No

Diff

Type: Diff

Required: No

Environment

Type: Map<String,String>

This property lets you set environment variables on the container that will deploy the CDK project. This way, the CDK project can get data from the deployment plan payload.

Your code can access these environment variables directly, via the Context configuration, or the StackConfiguration (parameters).

Example
Type: AttiniCdk
Properties:
    Path: my-app
    Environment:
      ENV.$: $.environment
      VPC_ID.$: $.output.vpc.id

Required: No

Stacks

Type: List<String>

The Stacks in your CDK project to deploy. If omitted, the --all option in the CDK CLI will be used.

Required: No

Default: All

Context

Type: Map<String,String>

This property is passed to the --context option in the CDK CLI.

Example
Type: AttiniCdk
Properties:
    Path: my-app
    Context:
      vpd_id: $.output.vpc.id

Required: No

Plugins

Type: List<String>

This property is passed to the --plugin option in the CDK CLI.

Required: No

StackConfiguration

Type: List<CdkParameters>

This property is passed to the --parameters option in the CDK CLI.

Required: No

Build

Type: String

This property is passed to the --build option in the CDK CLI.

Example
Type: AttiniCdk
Properties:
    Path: my-app
    Build: |
      echo "My build commands"
      npm install      

Required: No

BuildExclude

Type: List<String>

This property is passed to the --build-exclude option in the CDK CLI.

Required: No

NotificationArns

Type: List<String>

This property is passed to the --notification-arns option in the CDK CLI.

Required: No

Force

Type: Boolean

This property is passed to the --force option in the CDK CLI.

Required: No

RoleArn

Type: String

This property is passed to the --role-arn option in the CDK CLI.

Required: No