ServerDeploymentGroup

class aws_cdk.aws_codedeploy.ServerDeploymentGroup(scope, id, *, alarms=None, application=None, auto_rollback=None, auto_scaling_groups=None, deployment_config=None, deployment_group_name=None, ec2_instance_tags=None, ignore_poll_alarms_failure=None, install_agent=None, load_balancer=None, on_premise_instance_tags=None, role=None)

Bases: aws_cdk.core.Resource

A CodeDeploy Deployment Group that deploys to EC2/on-premise instances.

resource: :resource:: AWS::CodeDeploy::DeploymentGroup

__init__(scope, id, *, alarms=None, application=None, auto_rollback=None, auto_scaling_groups=None, deployment_config=None, deployment_group_name=None, ec2_instance_tags=None, ignore_poll_alarms_failure=None, install_agent=None, load_balancer=None, on_premise_instance_tags=None, role=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • alarms (Optional[List[IAlarm]]) – 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 {@link #addAlarm} method. Default: []

  • application (Optional[IServerApplication]) – The CodeDeploy EC2/on-premise Application this Deployment Group belongs to. Default: - A new Application will be created.

  • auto_rollback (Optional[AutoRollbackConfig]) – The auto-rollback configuration for this Deployment Group. Default: - default AutoRollbackConfig.

  • auto_scaling_groups (Optional[List[AutoScalingGroup]]) – The auto-scaling groups belonging to this Deployment Group. Auto-scaling groups can also be added after the Deployment Group is created using the {@link #addAutoScalingGroup} method. [disable-awslint:ref-via-interface] is needed because we update userdata for ASGs to install the codedeploy agent. Default: []

  • deployment_config (Optional[IServerDeploymentConfig]) – The EC2/on-premise Deployment Configuration to use for this Deployment Group. Default: ServerDeploymentConfig#OneAtATime

  • deployment_group_name (Optional[str]) – The physical, human-readable name of the CodeDeploy Deployment Group. Default: - An auto-generated name will be used.

  • ec2_instance_tags (Optional[InstanceTagSet]) – All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group. Default: - No additional EC2 instances will be added to the Deployment Group.

  • ignore_poll_alarms_failure (Optional[bool]) – Whether to continue a deployment even if fetching the alarm status from CloudWatch failed. Default: false

  • install_agent (Optional[bool]) – If you’ve provided any auto-scaling groups with the {@link #autoScalingGroups} property, you can set this property to add User Data that installs the CodeDeploy agent on the instances. Default: true

  • load_balancer (Optional[LoadBalancer]) – 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. Default: - Deployment Group will not have a load balancer defined.

  • on_premise_instance_tags (Optional[InstanceTagSet]) – All on-premise instances matching the given set of tags when a deployment occurs will be added to this Deployment Group. Default: - No additional on-premise instances will be added to the Deployment Group.

  • role (Optional[IRole]) – The service Role of this Deployment Group. Default: - A new Role will be created.

Return type

None

Methods

add_alarm(alarm)

Associates an additional alarm with this Deployment Group.

Parameters

alarm (IAlarm) – the alarm to associate with this Deployment Group.

Return type

None

add_auto_scaling_group(asg)

Adds an additional auto-scaling group to this Deployment Group.

Parameters

asg (AutoScalingGroup) – the auto-scaling group to add to this Deployment Group. [disable-awslint:ref-via-interface] is needed in order to install the code deploy agent by updating the ASGs user data.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

application
Return type

IServerApplication

auto_scaling_groups
Return type

Optional[List[AutoScalingGroup]]

deployment_config
Return type

IServerDeploymentConfig

deployment_group_arn
Return type

str

deployment_group_name
Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

role
Return type

Optional[IRole]

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_server_deployment_group_attributes(scope, id, *, application, deployment_group_name, deployment_config=None)

Import an EC2/on-premise Deployment Group defined either outside the CDK app, or in a different region.

Parameters
  • scope (Construct) – the parent Construct for this new Construct.

  • id (str) – the logical ID of this new Construct.

  • attrs – the properties of the referenced Deployment Group.

  • application (IServerApplication) – The reference to the CodeDeploy EC2/on-premise Application that this Deployment Group belongs to.

  • deployment_group_name (str) – The physical, human-readable name of the CodeDeploy EC2/on-premise Deployment Group that we are referencing.

  • deployment_config (Optional[IServerDeploymentConfig]) – The Deployment Configuration this Deployment Group uses. Default: ServerDeploymentConfig#OneAtATime

return :rtype: IServerDeploymentGroup :return: a Construct representing a reference to an existing Deployment Group

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool