Skip to the content.

automation Submodule

Constructs

BaseDockerProject

The base for Linux-based Docker build projects.

Initializers

import { automation } from 'shady-island'

new automation.BaseDockerProject(scope: Construct, id: string, props: BaseDockerProjectProps)
Name Type Description
scope constructs.Construct - The scope in which to define this construct.
id string - The scoped construct ID.
props BaseDockerProjectProps - Initialization properties for this construct.

scopeRequired

The scope in which to define this construct.


idRequired

The scoped construct ID.


propsRequired

Initialization properties for this construct.


Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { automation } from 'shady-island'

automation.BaseDockerProject.isConstruct(x: any)

Checks if x is a construct.

xRequired

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
buildSpec aws-cdk-lib.aws_codebuild.BuildSpec The CodeBuild build spec supplied.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
logGroup aws-cdk-lib.aws_logs.LogGroup The log group.
project aws-cdk-lib.aws_codebuild.PipelineProject The CodeBuild project.
stack aws-cdk-lib.Stack The stack in which this resource is defined.

nodeRequired
public readonly node: Node;

The tree node.


buildSpecRequired
public readonly buildSpec: BuildSpec;

The CodeBuild build spec supplied.


envRequired
public readonly env: ResourceEnvironment;

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


logGroupRequired
public readonly logGroup: LogGroup;

The log group.


projectRequired
public readonly project: PipelineProject;

The CodeBuild project.


stackRequired
public readonly stack: Stack;

The stack in which this resource is defined.


ContainerImagePipeline

Allows images pushed to an ECR repo to trigger updates to an ECS service.

This construct produces a CodePipeline pipeline using the “ECR Source” action, an “ECS Deploy” action, and a custom Lambda handler in between that transforms the JSON from the “Source” action into the JSON needed for the “Deploy” action.

Initializers

import { automation } from 'shady-island'

new automation.ContainerImagePipeline(scope: Construct, id: string, props: ContainerImagePipelineProps)
Name Type Description
scope constructs.Construct - The scope in which to define this construct.
id string - The scoped construct ID.
props ContainerImagePipelineProps - Initialization properties for this construct.

scopeRequired

The scope in which to define this construct.


idRequired

The scoped construct ID.


propsRequired

Initialization properties for this construct.


Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { automation } from 'shady-island'

automation.ContainerImagePipeline.isConstruct(x: any)

Checks if x is a construct.

xRequired

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
pipeline aws-cdk-lib.aws_codepipeline.Pipeline The CodePipeline pipeline.

nodeRequired
public readonly node: Node;

The tree node.


pipelineRequired
public readonly pipeline: Pipeline;

The CodePipeline pipeline.


LinuxDockerBuildProject

Sets up a standardized Docker build project.

This project accepts the following optional environment variables:

Initializers

import { automation } from 'shady-island'

new automation.LinuxDockerBuildProject(scope: Construct, id: string, props: LinuxDockerBuildProjectProps)
Name Type Description
scope constructs.Construct - The scope in which to define this construct.
id string - The scoped construct ID.
props LinuxDockerBuildProjectProps - Initialization properties for this construct.

scopeRequired

The scope in which to define this construct.


idRequired

The scoped construct ID.


propsRequired

Initialization properties for this construct.


Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { automation } from 'shady-island'

automation.LinuxDockerBuildProject.isConstruct(x: any)

Checks if x is a construct.

xRequired

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
buildSpec aws-cdk-lib.aws_codebuild.BuildSpec The CodeBuild build spec supplied.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
logGroup aws-cdk-lib.aws_logs.LogGroup The log group.
project aws-cdk-lib.aws_codebuild.PipelineProject The CodeBuild project.
stack aws-cdk-lib.Stack The stack in which this resource is defined.

nodeRequired
public readonly node: Node;

The tree node.


buildSpecRequired
public readonly buildSpec: BuildSpec;

The CodeBuild build spec supplied.


envRequired
public readonly env: ResourceEnvironment;

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


logGroupRequired
public readonly logGroup: LogGroup;

The log group.


projectRequired
public readonly project: PipelineProject;

The CodeBuild project.


stackRequired
public readonly stack: Stack;

The stack in which this resource is defined.


LinuxDockerManifestProject

Sets up a standardized Docker manifest build project.

This project accepts the following variables:

Initializers

import { automation } from 'shady-island'

new automation.LinuxDockerManifestProject(scope: Construct, id: string, props: LinuxDockerManifestProjectProps)
Name Type Description
scope constructs.Construct - The scope in which to define this construct.
id string - The scoped construct ID.
props LinuxDockerManifestProjectProps - Initialization properties for this construct.

scopeRequired

The scope in which to define this construct.


idRequired

The scoped construct ID.


propsRequired

Initialization properties for this construct.


Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { automation } from 'shady-island'

automation.LinuxDockerManifestProject.isConstruct(x: any)

Checks if x is a construct.

xRequired

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
buildSpec aws-cdk-lib.aws_codebuild.BuildSpec The CodeBuild build spec supplied.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
logGroup aws-cdk-lib.aws_logs.LogGroup The log group.
project aws-cdk-lib.aws_codebuild.PipelineProject The CodeBuild project.
stack aws-cdk-lib.Stack The stack in which this resource is defined.

nodeRequired
public readonly node: Node;

The tree node.


buildSpecRequired
public readonly buildSpec: BuildSpec;

The CodeBuild build spec supplied.


envRequired
public readonly env: ResourceEnvironment;

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


logGroupRequired
public readonly logGroup: LogGroup;

The log group.


projectRequired
public readonly project: PipelineProject;

The CodeBuild project.


stackRequired
public readonly stack: Stack;

The stack in which this resource is defined.


Structs

BaseDockerProjectProps

Constructor properties for BaseDockerProject.

Initializer

import { automation } from 'shady-island'

const baseDockerProjectProps: automation.BaseDockerProjectProps = { ... }

Properties

Name Type Description
repository aws-cdk-lib.aws_ecr.IRepository The ECR repository where images are pushed.
description string A description of this CodeBuild project.
logRetention aws-cdk-lib.aws_logs.RetentionDays The duration to retain log entries.
removalPolicy aws-cdk-lib.RemovalPolicy The removal policy for this project and its logs.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] Security groups to associate with the project’s network interfaces.
subnetSelection aws-cdk-lib.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
vpc aws-cdk-lib.aws_ec2.IVpc VPC network to place CodeBuild network interfaces.
buildEnvironment aws-cdk-lib.aws_codebuild.BuildEnvironment Build environment to use for the build.
buildSpec aws-cdk-lib.aws_codebuild.BuildSpec Filename or contents of buildspec in JSON format.

repositoryRequired
public readonly repository: IRepository;

The ECR repository where images are pushed.


descriptionOptional
public readonly description: string;

A description of this CodeBuild project.


logRetentionOptional
public readonly logRetention: RetentionDays;

The duration to retain log entries.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;

The removal policy for this project and its logs.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];

Security groups to associate with the project’s network interfaces.


subnetSelectionOptional
public readonly subnetSelection: SubnetSelection;

Where to place the network interfaces within the VPC.


vpcOptional
public readonly vpc: IVpc;

VPC network to place CodeBuild network interfaces.


buildEnvironmentRequired
public readonly buildEnvironment: BuildEnvironment;

Build environment to use for the build.


buildSpecRequired
public readonly buildSpec: BuildSpec;

Filename or contents of buildspec in JSON format.


CommonDockerProps

Common Docker build properties.

Initializer

import { automation } from 'shady-island'

const commonDockerProps: automation.CommonDockerProps = { ... }

Properties

Name Type Description
repository aws-cdk-lib.aws_ecr.IRepository The ECR repository where images are pushed.
description string A description of this CodeBuild project.
logRetention aws-cdk-lib.aws_logs.RetentionDays The duration to retain log entries.
removalPolicy aws-cdk-lib.RemovalPolicy The removal policy for this project and its logs.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] Security groups to associate with the project’s network interfaces.
subnetSelection aws-cdk-lib.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
vpc aws-cdk-lib.aws_ec2.IVpc VPC network to place CodeBuild network interfaces.

repositoryRequired
public readonly repository: IRepository;

The ECR repository where images are pushed.


descriptionOptional
public readonly description: string;

A description of this CodeBuild project.


logRetentionOptional
public readonly logRetention: RetentionDays;

The duration to retain log entries.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;

The removal policy for this project and its logs.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];

Security groups to associate with the project’s network interfaces.


subnetSelectionOptional
public readonly subnetSelection: SubnetSelection;

Where to place the network interfaces within the VPC.


vpcOptional
public readonly vpc: IVpc;

VPC network to place CodeBuild network interfaces.


ContainerImagePipelineProps

Properties for the ContainerImagePipeline constructor.

Initializer

import { automation } from 'shady-island'

const containerImagePipelineProps: automation.ContainerImagePipelineProps = { ... }

Properties

Name Type Description
container string The name of the container in the task definition to update.
repository aws-cdk-lib.aws_ecr.IRepository The ECR repository where images will be pushed.
service aws-cdk-lib.aws_ecs.IBaseService The ECS service to update when an image is pushed to the ECR repository.
artifactBucket aws-cdk-lib.aws_s3.IBucket A custom bucket for artifacts.
pipelineType aws-cdk-lib.aws_codepipeline.PipelineType The pipeline type (V1 or V2).
tag string The container image tag to observe for changes in the ECR repository.

containerRequired
public readonly container: string;

The name of the container in the task definition to update.


repositoryRequired
public readonly repository: IRepository;

The ECR repository where images will be pushed.


serviceRequired
public readonly service: IBaseService;

The ECS service to update when an image is pushed to the ECR repository.


artifactBucketOptional
public readonly artifactBucket: IBucket;

A custom bucket for artifacts.


pipelineTypeOptional
public readonly pipelineType: PipelineType;

The pipeline type (V1 or V2).


tagOptional
public readonly tag: string;

The container image tag to observe for changes in the ECR repository.


LinuxDockerBuildProjectProps

Constructor properties for LinuxDockerBuildProject.

Initializer

import { automation } from 'shady-island'

const linuxDockerBuildProjectProps: automation.LinuxDockerBuildProjectProps = { ... }

Properties

Name Type Description
repository aws-cdk-lib.aws_ecr.IRepository The ECR repository where images are pushed.
description string A description of this CodeBuild project.
logRetention aws-cdk-lib.aws_logs.RetentionDays The duration to retain log entries.
removalPolicy aws-cdk-lib.RemovalPolicy The removal policy for this project and its logs.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] Security groups to associate with the project’s network interfaces.
subnetSelection aws-cdk-lib.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
vpc aws-cdk-lib.aws_ec2.IVpc VPC network to place CodeBuild network interfaces.
buildDirectory string The build context directory.
buildImage aws-cdk-lib.aws_codebuild.IBuildImage The CodeBuild build image to use.
computeType aws-cdk-lib.aws_codebuild.ComputeType The type of compute to use for this build.
dockerfile string The filename of the Dockerfile.
enableCache boolean Whether to enable build caching.
pushLatest boolean Whether to push a “latest” tag.
testCommands string[] Commands used to test the image once built.

repositoryRequired
public readonly repository: IRepository;

The ECR repository where images are pushed.


descriptionOptional
public readonly description: string;

A description of this CodeBuild project.


logRetentionOptional
public readonly logRetention: RetentionDays;

The duration to retain log entries.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;

The removal policy for this project and its logs.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];

Security groups to associate with the project’s network interfaces.


subnetSelectionOptional
public readonly subnetSelection: SubnetSelection;

Where to place the network interfaces within the VPC.


vpcOptional
public readonly vpc: IVpc;

VPC network to place CodeBuild network interfaces.


buildDirectoryOptional
public readonly buildDirectory: string;

The build context directory.


buildImageOptional
public readonly buildImage: IBuildImage;

The CodeBuild build image to use.


computeTypeOptional
public readonly computeType: ComputeType;

The type of compute to use for this build.


dockerfileOptional
public readonly dockerfile: string;

The filename of the Dockerfile.


enableCacheOptional
public readonly enableCache: boolean;

Whether to enable build caching.


pushLatestOptional
public readonly pushLatest: boolean;

Whether to push a “latest” tag.


testCommandsOptional
public readonly testCommands: string[];

Commands used to test the image once built.


LinuxDockerManifestProjectProps

Constructor properties for LinuxDockerManifestProject.

Initializer

import { automation } from 'shady-island'

const linuxDockerManifestProjectProps: automation.LinuxDockerManifestProjectProps = { ... }

Properties

Name Type Description
repository aws-cdk-lib.aws_ecr.IRepository The ECR repository where images are pushed.
description string A description of this CodeBuild project.
logRetention aws-cdk-lib.aws_logs.RetentionDays The duration to retain log entries.
removalPolicy aws-cdk-lib.RemovalPolicy The removal policy for this project and its logs.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] Security groups to associate with the project’s network interfaces.
subnetSelection aws-cdk-lib.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
vpc aws-cdk-lib.aws_ec2.IVpc VPC network to place CodeBuild network interfaces.
tagVariableNames string[] The names of environment variables that contain the image hashes to add.
buildImage aws-cdk-lib.aws_codebuild.IBuildImage The CodeBuild build image to use.
computeType aws-cdk-lib.aws_codebuild.ComputeType The type of compute to use for this build.

repositoryRequired
public readonly repository: IRepository;

The ECR repository where images are pushed.


descriptionOptional
public readonly description: string;

A description of this CodeBuild project.


logRetentionOptional
public readonly logRetention: RetentionDays;

The duration to retain log entries.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;

The removal policy for this project and its logs.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];

Security groups to associate with the project’s network interfaces.


subnetSelectionOptional
public readonly subnetSelection: SubnetSelection;

Where to place the network interfaces within the VPC.


vpcOptional
public readonly vpc: IVpc;

VPC network to place CodeBuild network interfaces.


tagVariableNamesRequired
public readonly tagVariableNames: string[];

The names of environment variables that contain the image hashes to add.


buildImageOptional
public readonly buildImage: IBuildImage;

The CodeBuild build image to use.


computeTypeOptional
public readonly computeType: ComputeType;

The type of compute to use for this build.