Skip to content

Latest commit

 

History

History
3830 lines (2160 loc) · 70.7 KB

File metadata and controls

3830 lines (2160 loc) · 70.7 KB

README

@cloudcomponents/cdk-blue-green-container-deployment

@cloudcomponents/cdk-blue-green-container-deployment

Table of contents

Enumerations

Classes

Interfaces

Dummy Task Definition

@cloudcomponents/cdk-blue-green-container-deployment / DummyTaskDefinition

Class: DummyTaskDefinition

Hierarchy

  • Construct

    DummyTaskDefinition

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DummyTaskDefinition(scope, id, props)

Parameters

Name Type
scope Construct
id string
props DummyTaskDefinitionProps

Overrides

Construct.constructor

Properties

containerName

Readonly containerName: string

Implementation of

IDummyTaskDefinition.containerName


containerPort

Readonly containerPort: number

Implementation of

IDummyTaskDefinition.containerPort


executionRole

Readonly executionRole: IRole

Implementation of

IDummyTaskDefinition.executionRole


family

Readonly family: string

Implementation of

IDummyTaskDefinition.family


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node


tags

Readonly tags: TagManager

Implementation of

ITaggable.tags


taskDefinitionArn

Readonly taskDefinitionArn: string

Implementation of

IDummyTaskDefinition.taskDefinitionArn

Methods

addToExecutionRolePolicy

addToExecutionRolePolicy(statement): void

Adds a policy statement to the task execution IAM role.

Parameters

Name Type
statement PolicyStatement

Returns

void


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Ecs Deployment Config

@cloudcomponents/cdk-blue-green-container-deployment / EcsDeploymentConfig

Class: EcsDeploymentConfig

Hierarchy

  • Resource

    EcsDeploymentConfig

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EcsDeploymentConfig(scope, id, props)

Parameters

Name Type
scope Construct
id string
props EcsDeploymentConfigurationProps

Overrides

Resource.constructor

Properties

deploymentConfigArn

Readonly deploymentConfigArn: string

Implementation of

IEcsDeploymentConfig.deploymentConfigArn


deploymentConfigName

Readonly deploymentConfigName: string

Implementation of

IEcsDeploymentConfig.deploymentConfigName


env

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.

stability stable

Inherited from

Resource.env


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Resource.node


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

Resource.physicalName


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

Resource.stack


ALL_AT_ONCE

Static Readonly ALL_AT_ONCE: IEcsDeploymentConfig


CANARY_10PERCENT_15MINUTES

Static Readonly CANARY_10PERCENT_15MINUTES: IEcsDeploymentConfig


CANARY_10PERCENT_5MINUTES

Static Readonly CANARY_10PERCENT_5MINUTES: IEcsDeploymentConfig


LINEAR_10PERCENT_EVERY_1MINUTE

Static Readonly LINEAR_10PERCENT_EVERY_1MINUTE: IEcsDeploymentConfig


LINEAR_10PERCENT_EVERY_3MINUTES

Static Readonly LINEAR_10PERCENT_EVERY_3MINUTES: IEcsDeploymentConfig

Methods

_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

Resource._enableCrossEnvironment


applyRemovalPolicy

applyRemovalPolicy(policy): 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).

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

Resource.applyRemovalPolicy


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

Resource.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

Resource.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

Resource.getResourceNameAttribute


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Resource.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Resource.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Resource.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Resource.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Resource.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Resource.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Resource.validate


fromEcsDeploymentConfigName

Static fromEcsDeploymentConfigName(_scope, _id, ecsDeploymentConfigName): IEcsDeploymentConfig

Import a custom Deployment Configuration for an ECS Deployment Group defined outside the CDK.

Parameters

Name Type Description
_scope Construct the parent Construct for this new Construct
_id string the logical ID of this new Construct
ecsDeploymentConfigName string the name of the referenced custom Deployment Configuration

Returns

IEcsDeploymentConfig

a Construct representing a reference to an existing custom Deployment Configuration


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Resource.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

Resource.isResource

Ecs Deployment Group

@cloudcomponents/cdk-blue-green-container-deployment / EcsDeploymentGroup

Class: EcsDeploymentGroup

Hierarchy

  • Resource

    EcsDeploymentGroup

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EcsDeploymentGroup(scope, id, props)

Parameters

Name Type
scope Construct
id string
props EcsDeploymentGroupProps

Overrides

Resource.constructor

Properties

application

Readonly application: IEcsApplication

The reference to the CodeDeploy ECS Application that this Deployment Group belongs to.

Implementation of

IEcsDeploymentGroup.application


deploymentConfig

Readonly deploymentConfig: IEcsDeploymentConfig

The Deployment Configuration this Group uses.

Implementation of

IEcsDeploymentGroup.deploymentConfig


deploymentGroupArn

Readonly deploymentGroupArn: string

The ARN of this Deployment Group.

Implementation of

IEcsDeploymentGroup.deploymentGroupArn


deploymentGroupName

Readonly deploymentGroupName: string

The physical name of the CodeDeploy Deployment Group.

Implementation of

IEcsDeploymentGroup.deploymentGroupName


env

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.

stability stable

Implementation of

IEcsDeploymentGroup.env

Inherited from

Resource.env


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Implementation of

IEcsDeploymentGroup.node

Inherited from

Resource.node


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

Resource.physicalName


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Implementation of

IEcsDeploymentGroup.stack

Inherited from

Resource.stack


tags

Readonly tags: TagManager

Implementation of

ITaggable.tags

Methods

_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

Resource._enableCrossEnvironment


applyRemovalPolicy

applyRemovalPolicy(policy): 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).

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Implementation of

IEcsDeploymentGroup.applyRemovalPolicy

Inherited from

Resource.applyRemovalPolicy


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

Resource.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

Resource.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

Resource.getResourceNameAttribute


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Resource.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Resource.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Resource.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Resource.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Resource.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Resource.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Resource.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Resource.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

Resource.isResource

Ecs Service

@cloudcomponents/cdk-blue-green-container-deployment / EcsService

Class: EcsService

Hierarchy

  • Construct

    EcsService

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EcsService(scope, id, props)

Parameters

Name Type
scope Construct
id string
props EcsServiceProps

Overrides

Construct.constructor

Properties

clusterName

Readonly clusterName: string

Implementation of

IEcsService.clusterName


connections

Readonly connections: Connections

Implementation of

IConnectable.connections


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node


serviceName

Readonly serviceName: string

Implementation of

IEcsService.serviceName


tags

Readonly tags: TagManager

Implementation of

ITaggable.tags

Methods

onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Push Image Project

@cloudcomponents/cdk-blue-green-container-deployment / PushImageProject

Class: PushImageProject

Hierarchy

  • PipelineProject

    PushImageProject

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PushImageProject(scope, id, props)

Parameters

Name Type
scope Construct
id string
props PushImageProjectProps

Overrides

PipelineProject.constructor

Properties

_connections

Protected _connections: undefined | Connections

Actual connections object for this Project. May be unset, in which case this Project is not configured to use a VPC.

internal

Inherited from

PipelineProject._connections


env

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.

stability stable

Inherited from

PipelineProject.env


grantPrincipal

Readonly grantPrincipal: IPrincipal

The principal to grant permissions to.

stability stable

Inherited from

PipelineProject.grantPrincipal


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

PipelineProject.node


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

PipelineProject.physicalName


projectArn

Readonly projectArn: string

The ARN of the project.

stability stable

Inherited from

PipelineProject.projectArn


projectName

Readonly projectName: string

The name of the project.

stability stable

Inherited from

PipelineProject.projectName


role

Optional Readonly role: IRole

The IAM role for this project.

stability stable

Inherited from

PipelineProject.role


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

PipelineProject.stack

Accessors

connections

get connections(): Connections

Access the Connections object.

Will fail if this Project does not have a VPC set.

stability stable

Returns

Connections

Inherited from

PipelineProject.connections


encryptionKey

Private set encryptionKey(value): void

Parameters

Name Type
value any

Returns

void

Inherited from

PipelineProject.encryptionKey

Methods

_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

PipelineProject._enableCrossEnvironment


addFileSystemLocation

addFileSystemLocation(fileSystemLocation): void

Adds a fileSystemLocation to the Project.

stability stable

Parameters

Name Type Description
fileSystemLocation IFileSystemLocation the fileSystemLocation to add.

Returns

void

Inherited from

PipelineProject.addFileSystemLocation


addSecondaryArtifact

addSecondaryArtifact(secondaryArtifact): void

Adds a secondary artifact to the Project.

see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html

stability stable

Parameters

Name Type Description
secondaryArtifact IArtifacts the artifact to add as a secondary artifact.

Returns

void

Inherited from

PipelineProject.addSecondaryArtifact


addSecondarySource

addSecondarySource(secondarySource): void

Adds a secondary source to the Project.

see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html

stability stable

Parameters

Name Type Description
secondarySource ISource the source to add as a secondary source.

Returns

void

Inherited from

PipelineProject.addSecondarySource


addToRolePolicy

addToRolePolicy(statement): void

Add a permission only if there's a policy attached.

stability stable

Parameters

Name Type Description
statement PolicyStatement The permissions statement to add.

Returns

void

Inherited from

PipelineProject.addToRolePolicy


applyRemovalPolicy

applyRemovalPolicy(policy): 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).

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

PipelineProject.applyRemovalPolicy


bindAsNotificationRuleSource

bindAsNotificationRuleSource(_scope): NotificationRuleSourceConfig

Returns a source configuration for notification rule.

stability stable

Parameters

Name Type
_scope Construct

Returns

NotificationRuleSourceConfig

Inherited from

PipelineProject.bindAsNotificationRuleSource


bindToCodePipeline

bindToCodePipeline(_scope, options): void

A callback invoked when the given project is added to a CodePipeline.

stability stable

Parameters

Name Type Description
_scope Construct the construct the binding is taking place in.
options BindToCodePipelineOptions additional options for the binding.

Returns

void

Inherited from

PipelineProject.bindToCodePipeline


enableBatchBuilds

enableBatchBuilds(): undefined | BatchBuildConfig

Enable batch builds.

Returns an object contining the batch service role if batch builds could be enabled.

stability stable

Returns

undefined | BatchBuildConfig

Inherited from

PipelineProject.enableBatchBuilds


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

PipelineProject.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

PipelineProject.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

PipelineProject.getResourceNameAttribute


metric

metric(metricName, props?): Metric

stability stable

Parameters

Name Type Description
metricName string The name of the metric.
props? MetricOptions Customization properties.

Returns

Metric

a CloudWatch metric associated with this build project.

Inherited from

PipelineProject.metric


metricBuilds

metricBuilds(props?): Metric

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

PipelineProject.metricBuilds


metricDuration

metricDuration(props?): Metric

Measures the duration of all builds over time.

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

default average over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

PipelineProject.metricDuration


metricFailedBuilds

metricFailedBuilds(props?): Metric

Measures the number of builds that failed because of client error or because of a timeout.

Units: Count

Valid CloudWatch statistics: Sum

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

PipelineProject.metricFailedBuilds


metricSucceededBuilds

metricSucceededBuilds(props?): Metric

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

PipelineProject.metricSucceededBuilds


notifyOn

notifyOn(id, target, options): INotificationRule

Defines a CodeStar Notification rule triggered when the project events emitted by you specified, it very similar to onEvent API.

You can also use the methods notifyOnBuildSucceeded and notifyOnBuildFailed to define rules for these specific event emitted.

stability stable

Parameters

Name Type
id string
target INotificationRuleTarget
options ProjectNotifyOnOptions

Returns

INotificationRule

Inherited from

PipelineProject.notifyOn


notifyOnBuildFailed

notifyOnBuildFailed(id, target, options?): INotificationRule

Defines a CodeStar notification rule which triggers when a build fails.

stability stable

Parameters

Name Type
id string
target INotificationRuleTarget
options? NotificationRuleOptions

Returns

INotificationRule

Inherited from

PipelineProject.notifyOnBuildFailed


notifyOnBuildSucceeded

notifyOnBuildSucceeded(id, target, options?): INotificationRule

Defines a CodeStar notification rule which triggers when a build completes successfully.

stability stable

Parameters

Name Type
id string
target INotificationRuleTarget
options? NotificationRuleOptions

Returns

INotificationRule

Inherited from

PipelineProject.notifyOnBuildSucceeded


onBuildFailed

onBuildFailed(id, options?): Rule

Defines an event rule which triggers when a build fails.

To access fields from the event in the event target input, use the static fields on the StateChangeEvent class.

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onBuildFailed


onBuildStarted

onBuildStarted(id, options?): Rule

Defines an event rule which triggers when a build starts.

To access fields from the event in the event target input, use the static fields on the StateChangeEvent class.

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onBuildStarted


onBuildSucceeded

onBuildSucceeded(id, options?): Rule

Defines an event rule which triggers when a build completes successfully.

To access fields from the event in the event target input, use the static fields on the StateChangeEvent class.

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onBuildSucceeded


onEvent

onEvent(id, options?): Rule

Defines a CloudWatch event rule triggered when something happens with this project.

see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onEvent


onPhaseChange

onPhaseChange(id, options?): Rule

Defines a CloudWatch event rule that triggers upon phase change of this build project.

see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onPhaseChange


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

PipelineProject.onPrepare


onStateChange

onStateChange(id, options?): Rule

Defines a CloudWatch event rule triggered when the build project state changes.

You can filter specific build status events using an event pattern filter on the build-status detail field:

const rule = project.onStateChange('OnBuildStarted', { target });
rule.addEventPattern({
  detail: {
    'build-status': [
      "IN_PROGRESS",
      "SUCCEEDED",
      "FAILED",
      "STOPPED"
    ]
  }
});

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for these specific state changes.

To access fields from the event in the event target input, use the static fields on the StateChangeEvent class.

see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html

stability stable

Parameters

Name Type
id string
options? OnEventOptions

Returns

Rule

Inherited from

PipelineProject.onStateChange


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

PipelineProject.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

PipelineProject.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

PipelineProject.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

PipelineProject.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

PipelineProject.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

override true

Returns

string[]

Inherited from

PipelineProject.validate


fromProjectArn

Static fromProjectArn(scope, id, projectArn): IProject

stability stable

Parameters

Name Type
scope Construct
id string
projectArn string

Returns

IProject

Inherited from

PipelineProject.fromProjectArn


fromProjectName

Static fromProjectName(scope, id, projectName): IProject

Import a Project defined either outside the CDK, or in a different CDK Stack (and exported using the {@link export} method).

stability stable

note if you're importing a CodeBuild Project for use in a CodePipeline, make sure the existing Project has permissions to access the S3 Bucket of that Pipeline - otherwise, builds in that Pipeline will always fail.

Parameters

Name Type Description
scope Construct the parent Construct for this Construct.
id string the logical name of this Construct.
projectName string the name of the project to import.

Returns

IProject

a reference to the existing Project

Inherited from

PipelineProject.fromProjectName


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

PipelineProject.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

PipelineProject.isResource


serializeEnvVariables

Static serializeEnvVariables(environmentVariables, validateNoPlainTextSecrets?, principal?): EnvironmentVariableProperty[]

Convert the environment variables map of string to {@link BuildEnvironmentVariable}, which is the customer-facing type, to a list of {@link CfnProject.EnvironmentVariableProperty}, which is the representation of environment variables in CloudFormation.

stability stable

Parameters

Name Type Description
environmentVariables Object the map of string to environment variables.
validateNoPlainTextSecrets? boolean whether to throw an exception if any of the plain text environment variables contain secrets, defaults to 'false'.
principal? IGrantable -

Returns

EnvironmentVariableProperty[]

an array of {@link CfnProject.EnvironmentVariableProperty} instances

Inherited from

PipelineProject.serializeEnvVariables

Propagate Tags

@cloudcomponents/cdk-blue-green-container-deployment / PropagateTags

Enumeration: PropagateTags

Table of contents

Enumeration members

Enumeration members

SERVICE

SERVICE = "SERVICE"


TASK_DEFINITION

TASK_DEFINITION = "TASK_DEFINITION"

Rollback Event

@cloudcomponents/cdk-blue-green-container-deployment / RollbackEvent

Enumeration: RollbackEvent

Table of contents

Enumeration members

Enumeration members

DEPLOYMENT_FAILURE

DEPLOYMENT_FAILURE = "DEPLOYMENT_FAILURE"


DEPLOYMENT_STOP_ON_ALARM

DEPLOYMENT_STOP_ON_ALARM = "DEPLOYMENT_STOP_ON_ALARM"


DEPLOYMENT_STOP_ON_REQUEST

DEPLOYMENT_STOP_ON_REQUEST = "DEPLOYMENT_STOP_ON_REQUEST"

Scheduling Strategy

@cloudcomponents/cdk-blue-green-container-deployment / SchedulingStrategy

Enumeration: SchedulingStrategy

Table of contents

Enumeration members

Enumeration members

DAEMON

DAEMON = "DAEMON"


REPLICA

REPLICA = "REPLICA"

Dummy Task Definition Props

@cloudcomponents/cdk-blue-green-container-deployment / DummyTaskDefinitionProps

Interface: DummyTaskDefinitionProps

Table of contents

Properties

Properties

containerName

Optional Readonly containerName: string

The name of the container.

default sample-website


containerPort

Optional Readonly containerPort: number

default 80


family

Optional Readonly family: string

The name of a family that this task definition is registered to. A family groups multiple versions of a task definition.

default - Automatically generated name.


image

Readonly image: string

The image used to start a container.

Ecs Deployment Configuration Props

@cloudcomponents/cdk-blue-green-container-deployment / EcsDeploymentConfigurationProps

Interface: EcsDeploymentConfigurationProps

Table of contents

Properties

Properties

deploymentConfigName

Optional Readonly deploymentConfigName: string

AWS::CodeDeploy::DeploymentConfig.DeploymentConfigName.

external

link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentconfig.html#cfn-codedeploy-deploymentconfig-deploymentconfigname


minimumHealthyHosts

Optional Readonly minimumHealthyHosts: MinimumHealthyHostsProperty | IResolvable

AWS::CodeDeploy::DeploymentConfig.MinimumHealthyHosts.

external

link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentconfig.html#cfn-codedeploy-deploymentconfig-minimumhealthyhosts


trafficRoutingConfig

Optional Readonly trafficRoutingConfig: IResolvable | TrafficRoutingConfigProperty

AWS::CodeDeploy::DeploymentConfig.TrafficRoutingConfig.

external

link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentconfig.html#cfn-codedeploy-deploymentconfig-trafficroutingconfig

Ecs Deployment Group Props

@cloudcomponents/cdk-blue-green-container-deployment / EcsDeploymentGroupProps

Interface: EcsDeploymentGroupProps

Table of contents

Properties

Properties

applicationName

Optional Readonly applicationName: string


autoRollbackOnEvents

Optional Readonly autoRollbackOnEvents: RollbackEvent[]

The event type or types that trigger a rollback.


deploymentConfig

Optional Readonly deploymentConfig: IEcsDeploymentConfig


deploymentGroupName

Readonly deploymentGroupName: string


ecsServices

Readonly ecsServices: IEcsService[]


prodTrafficListener

Readonly prodTrafficListener: TrafficListener


targetGroups

Readonly targetGroups: ApplicationTargetGroup[]


terminationWaitTime

Optional Readonly terminationWaitTime: Duration

the number of minutes before deleting the original (blue) task set. During an Amazon ECS deployment, CodeDeploy shifts traffic from the original (blue) task set to a replacement (green) task set.

The maximum setting is 2880 minutes (2 days).

default 60 minutes


testTrafficListener

Readonly testTrafficListener: TrafficListener

Ecs Service Props

@cloudcomponents/cdk-blue-green-container-deployment / EcsServiceProps

Interface: EcsServiceProps

Table of contents

Properties

Properties

circuitBreaker

Optional Readonly circuitBreaker: DeploymentCircuitBreaker

Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled.

default - disabled


cluster

Readonly cluster: ICluster


containerPort

Optional Readonly containerPort: number


desiredCount

Optional Readonly desiredCount: number


healthCheckGracePeriod

Optional Readonly healthCheckGracePeriod: Duration

The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.

default - defaults to 60 seconds if at least one load balancer is in-use and it is not already set


launchType

Optional Readonly launchType: LaunchType


maxHealthyPercent

Optional Readonly maxHealthyPercent: number

The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.

default - 100 if daemon, otherwise 200


minHealthyPercent

Optional Readonly minHealthyPercent: number

The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.

default - 0 if daemon, otherwise 50


platformVersion

Optional Readonly platformVersion: string


prodTargetGroup

Readonly prodTargetGroup: ITargetGroup


propagateTags

Optional Readonly propagateTags: PropagateTags

Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. If no value is specified, the tags aren't propagated.

default - no propagate


securityGroups

Optional Readonly securityGroups: SecurityGroup[]


serviceName

Readonly serviceName: string


taskDefinition

Readonly taskDefinition: DummyTaskDefinition


testTargetGroup

Readonly testTargetGroup: ITargetGroup

I Dummy Task Definition

@cloudcomponents/cdk-blue-green-container-deployment / IDummyTaskDefinition

Interface: IDummyTaskDefinition

Implemented by

Table of contents

Properties

Properties

containerName

Readonly containerName: string


containerPort

Readonly containerPort: number


executionRole

Readonly executionRole: IRole


family

Readonly family: string


taskDefinitionArn

Readonly taskDefinitionArn: string

I Ecs Deployment Config

@cloudcomponents/cdk-blue-green-container-deployment / IEcsDeploymentConfig

Interface: IEcsDeploymentConfig

Implemented by

Table of contents

Properties

Properties

deploymentConfigArn

Readonly deploymentConfigArn: string


deploymentConfigName

Readonly deploymentConfigName: string

I Ecs Deployment Group

@cloudcomponents/cdk-blue-green-container-deployment / IEcsDeploymentGroup

Interface: IEcsDeploymentGroup

Interface for an ECS deployment group.

Hierarchy

  • IResource

    IEcsDeploymentGroup

Implemented by

Table of contents

Properties

Methods

Properties

application

Readonly application: IEcsApplication

The reference to the CodeDeploy ECS Application that this Deployment Group belongs to.


deploymentConfig

Readonly deploymentConfig: IEcsDeploymentConfig

The Deployment Configuration this Group uses.


deploymentGroupArn

Readonly deploymentGroupArn: string

The ARN of this Deployment Group.


deploymentGroupName

Readonly deploymentGroupName: string

The physical name of the CodeDeploy Deployment Group.


env

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.

stability stable

Inherited from

IResource.env


node

Readonly node: ConstructNode

The construct tree node for this construct.

stability stable

Inherited from

IResource.node


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

IResource.stack

Methods

applyRemovalPolicy

applyRemovalPolicy(policy): 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).

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

IResource.applyRemovalPolicy

I Ecs Service

@cloudcomponents/cdk-blue-green-container-deployment / IEcsService

Interface: IEcsService

Implemented by

Table of contents

Properties

Properties

clusterName

Readonly clusterName: string


serviceName

Readonly serviceName: string

Push Image Project Props

@cloudcomponents/cdk-blue-green-container-deployment / PushImageProjectProps

Interface: PushImageProjectProps

Table of contents

Properties

Properties

buildSpec

Optional Readonly buildSpec: BuildSpec


cache

Optional Readonly cache: Cache


computeType

Optional Readonly computeType: ComputeType


environmentVariables

Optional Readonly environmentVariables: Record<string, BuildEnvironmentVariable>


imageRepository

Readonly imageRepository: IRepository


projectName

Optional Readonly projectName: string


taskDefinition

Readonly taskDefinition: IDummyTaskDefinition

Traffic Listener

@cloudcomponents/cdk-blue-green-container-deployment / TrafficListener

Interface: TrafficListener

Table of contents

Properties

Properties

listenerArn

Readonly listenerArn: string

ARN of the listener

attribute