Skip to content

Latest commit

 

History

History
587 lines (366 loc) · 27.3 KB

File metadata and controls

587 lines (366 loc) · 27.3 KB

API Reference

Constructs

ServerBlueGreenDeploymentGroup

  • Implements: aws-cdk-lib.aws_codedeploy.IServerDeploymentGroup

Initializers

import { ServerBlueGreenDeploymentGroup } from '@otocolobus/aws-cdk-serverbluegreendeploymentgroup'

new ServerBlueGreenDeploymentGroup(scope: Stack, id: string, props: ServerBlueGreenDeploymentGroupProps)
Name Type Description
scope aws-cdk-lib.Stack No description.
id string No description.
props ServerBlueGreenDeploymentGroupProps No description.

scopeRequired
  • Type: aws-cdk-lib.Stack

idRequired
  • Type: string

propsRequired

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
  • Type: aws-cdk-lib.RemovalPolicy

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.

isConstruct
import { ServerBlueGreenDeploymentGroup } from '@otocolobus/aws-cdk-serverbluegreendeploymentgroup'

ServerBlueGreenDeploymentGroup.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isOwnedResource
import { ServerBlueGreenDeploymentGroup } from '@otocolobus/aws-cdk-serverbluegreendeploymentgroup'

ServerBlueGreenDeploymentGroup.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { ServerBlueGreenDeploymentGroup } from '@otocolobus/aws-cdk-serverbluegreendeploymentgroup'

ServerBlueGreenDeploymentGroup.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
application aws-cdk-lib.aws_codedeploy.IServerApplication No description.
deploymentConfig aws-cdk-lib.aws_codedeploy.IServerDeploymentConfig No description.
deploymentGroupArn string No description.
deploymentGroupName string No description.
autoScalingGroups aws-cdk-lib.aws_autoscaling.IAutoScalingGroup[] No description.
role aws-cdk-lib.aws_iam.IRole No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.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.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


applicationRequired
public readonly application: IServerApplication;
  • Type: aws-cdk-lib.aws_codedeploy.IServerApplication

deploymentConfigRequired
public readonly deploymentConfig: IServerDeploymentConfig;
  • Type: aws-cdk-lib.aws_codedeploy.IServerDeploymentConfig

deploymentGroupArnRequired
public readonly deploymentGroupArn: string;
  • Type: string

deploymentGroupNameRequired
public readonly deploymentGroupName: string;
  • Type: string

autoScalingGroupsOptional
public readonly autoScalingGroups: IAutoScalingGroup[];
  • Type: aws-cdk-lib.aws_autoscaling.IAutoScalingGroup[]

roleOptional
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole

Structs

ServerBlueGreenDeploymentGroupProps

Initializer

import { ServerBlueGreenDeploymentGroupProps } from '@otocolobus/aws-cdk-serverbluegreendeploymentgroup'

const serverBlueGreenDeploymentGroupProps: ServerBlueGreenDeploymentGroupProps = { ... }

Properties

Name Type Description
alarms aws-cdk-lib.aws_cloudwatch.IAlarm[] The CloudWatch alarms associated with this Deployment Group.
application aws-cdk-lib.aws_codedeploy.IServerApplication The CodeDeploy EC2/on-premise Application this Deployment Group belongs to.
autoRollback aws-cdk-lib.aws_codedeploy.AutoRollbackConfig The auto-rollback configuration for this Deployment Group.
autoScalingGroups aws-cdk-lib.aws_autoscaling.IAutoScalingGroup[] The auto-scaling groups belonging to this Deployment Group.
deploymentConfig aws-cdk-lib.aws_codedeploy.IServerDeploymentConfig The EC2/on-premise Deployment Configuration to use for this Deployment Group.
deploymentGroupName string The physical, human-readable name of the CodeDeploy Deployment Group.
ec2InstanceTags aws-cdk-lib.aws_codedeploy.InstanceTagSet All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.
ignoreAlarmConfiguration boolean Whether to skip the step of checking CloudWatch alarms during the deployment process.
ignorePollAlarmsFailure boolean Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.
installAgent boolean If you've provided any auto-scaling groups with the #autoScalingGroups property, you can set this property to add User Data that installs the CodeDeploy agent on the instances.
loadBalancer aws-cdk-lib.aws_codedeploy.LoadBalancer The load balancer to place in front of this Deployment Group.
loadBalancers aws-cdk-lib.aws_codedeploy.LoadBalancer[] CodeDeploy supports the deployment to multiple load balancers.
onPremiseInstanceTags aws-cdk-lib.aws_codedeploy.InstanceTagSet All on-premise instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.
role aws-cdk-lib.aws_iam.IRole The service Role of this Deployment Group.
terminationHook boolean Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
greenFleetProvisionOption string How to provision the green fleet.
manualTrafficRoutingTimeout aws-cdk-lib.Duration How long to wait for the manual traffic rerouting to complete.
originalInstancePolicy string The action to take on instances in the original environment after a successful blue/green deployment.
terminateOriginalInstancesTimeout aws-cdk-lib.Duration How long to wait before terminating the original instances.
trafficRoutingConfig string How to reroute traffic to the green fleet.

alarmsOptional
public readonly alarms: IAlarm[];
  • Type: aws-cdk-lib.aws_cloudwatch.IAlarm[]
  • Default: []

The CloudWatch alarms associated with this Deployment Group.

CodeDeploy will stop (and optionally roll back) a deployment if during it any of the alarms trigger.

Alarms can also be added after the Deployment Group is created using the #addAlarm method.

https://docs.aws.amazon.com/codedeploy/latest/userguide/monitoring-create-alarms.html


applicationOptional
public readonly application: IServerApplication;
  • Type: aws-cdk-lib.aws_codedeploy.IServerApplication
  • Default: A new Application will be created.

The CodeDeploy EC2/on-premise Application this Deployment Group belongs to.


autoRollbackOptional
public readonly autoRollback: AutoRollbackConfig;
  • Type: aws-cdk-lib.aws_codedeploy.AutoRollbackConfig
  • Default: default AutoRollbackConfig.

The auto-rollback configuration for this Deployment Group.


autoScalingGroupsOptional
public readonly autoScalingGroups: IAutoScalingGroup[];
  • Type: aws-cdk-lib.aws_autoscaling.IAutoScalingGroup[]
  • Default: []

The auto-scaling groups belonging to this Deployment Group.

Auto-scaling groups can also be added after the Deployment Group is created using the #addAutoScalingGroup method.

[disable-awslint:ref-via-interface] is needed because we update userdata for ASGs to install the codedeploy agent.


deploymentConfigOptional
public readonly deploymentConfig: IServerDeploymentConfig;
  • Type: aws-cdk-lib.aws_codedeploy.IServerDeploymentConfig
  • Default: ServerDeploymentConfig#OneAtATime

The EC2/on-premise Deployment Configuration to use for this Deployment Group.


deploymentGroupNameOptional
public readonly deploymentGroupName: string;
  • Type: string
  • Default: An auto-generated name will be used.

The physical, human-readable name of the CodeDeploy Deployment Group.


ec2InstanceTagsOptional
public readonly ec2InstanceTags: InstanceTagSet;
  • Type: aws-cdk-lib.aws_codedeploy.InstanceTagSet
  • Default: No additional EC2 instances will be added to the Deployment Group.

All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.


ignoreAlarmConfigurationOptional
public readonly ignoreAlarmConfiguration: boolean;
  • Type: boolean
  • Default: false

Whether to skip the step of checking CloudWatch alarms during the deployment process.


ignorePollAlarmsFailureOptional
public readonly ignorePollAlarmsFailure: boolean;
  • Type: boolean
  • Default: false

Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.


installAgentOptional
public readonly installAgent: boolean;
  • Type: boolean
  • Default: true

If you've provided any auto-scaling groups with the #autoScalingGroups property, you can set this property to add User Data that installs the CodeDeploy agent on the instances.

https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install.html


loadBalancerOptional
  • Deprecated: - Use loadBalancers instead.
public readonly loadBalancer: LoadBalancer;
  • Type: aws-cdk-lib.aws_codedeploy.LoadBalancer
  • Default: Deployment Group will not have a load balancer defined.

The load balancer to place in front of this Deployment Group.

Can be created from either a classic Elastic Load Balancer, or an Application Load Balancer / Network Load Balancer Target Group.


loadBalancersOptional
public readonly loadBalancers: LoadBalancer[];
  • Type: aws-cdk-lib.aws_codedeploy.LoadBalancer[]
  • Default: Deployment Group will not have load balancers defined.

CodeDeploy supports the deployment to multiple load balancers.

Specify either multiple Classic Load Balancers, or Application Load Balancers / Network Load Balancers Target Groups.


onPremiseInstanceTagsOptional
public readonly onPremiseInstanceTags: InstanceTagSet;
  • Type: aws-cdk-lib.aws_codedeploy.InstanceTagSet
  • Default: No additional on-premise instances will be added to the Deployment Group.

All on-premise instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.


roleOptional
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: A new Role will be created.

The service Role of this Deployment Group.


terminationHookOptional
public readonly terminationHook: boolean;
  • Type: boolean
  • Default: false

Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.

https://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-aws-auto-scaling.html#integrations-aws-auto-scaling-behaviors


greenFleetProvisionOptionOptional
public readonly greenFleetProvisionOption: string;
  • Type: string
  • Default: COPY_AUTO_SCALING_GROUP

How to provision the green fleet.


manualTrafficRoutingTimeoutOptional
public readonly manualTrafficRoutingTimeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: if trafficRoutingConfig is MANUALLY, this is required - otherwise, this is ignored.

How long to wait for the manual traffic rerouting to complete.


originalInstancePolicyOptional
public readonly originalInstancePolicy: string;
  • Type: string
  • Default: TERMINATE

The action to take on instances in the original environment after a successful blue/green deployment.


terminateOriginalInstancesTimeoutOptional
public readonly terminateOriginalInstancesTimeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: if originalInstancePolicy is TERMINATE, this is required - otherwise, this is ignored.

How long to wait before terminating the original instances.


trafficRoutingConfigOptional
public readonly trafficRoutingConfig: string;
  • Type: string
  • Default: AUTOMATICALLY

How to reroute traffic to the green fleet.