Class: AWSCDK::CodeDeploy::ServerDeploymentGroupProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_deploy/server_deployment_group_props.rb

Overview

Construction properties for ServerDeploymentGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alarms: nil, application: nil, auto_rollback: nil, auto_scaling_groups: nil, deployment_config: nil, deployment_group_name: nil, ec2_instance_tags: nil, ignore_alarm_configuration: nil, ignore_poll_alarms_failure: nil, install_agent: nil, load_balancer: nil, load_balancers: nil, on_premise_instance_tags: nil, role: nil, termination_hook: nil) ⇒ ServerDeploymentGroupProps

Returns a new instance of ServerDeploymentGroupProps.

Parameters:

  • alarms (Array<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>, nil) (defaults to: nil)

    The CloudWatch alarms associated with this Deployment Group.

  • application (AWSCDK::Interfaces::AWSCodedeploy::IApplicationRef, nil) (defaults to: nil)

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

  • auto_rollback (AWSCDK::CodeDeploy::AutoRollbackConfig, nil) (defaults to: nil)

    The auto-rollback configuration for this Deployment Group.

  • auto_scaling_groups (Array<AWSCDK::Autoscaling::IAutoScalingGroup>, nil) (defaults to: nil)

    The auto-scaling groups belonging to this Deployment Group.

  • deployment_config (AWSCDK::Interfaces::AWSCodedeploy::IDeploymentConfigRef, nil) (defaults to: nil)

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

  • deployment_group_name (String, nil) (defaults to: nil)

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

  • ec2_instance_tags (AWSCDK::CodeDeploy::InstanceTagSet, nil) (defaults to: nil)

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

  • ignore_alarm_configuration (Boolean, nil) (defaults to: nil)

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

  • ignore_poll_alarms_failure (Boolean, nil) (defaults to: nil)

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

  • install_agent (Boolean, nil) (defaults to: nil)

    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.

  • load_balancer (AWSCDK::CodeDeploy::LoadBalancer, nil) (defaults to: nil)

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

  • load_balancers (Array<AWSCDK::CodeDeploy::LoadBalancer>, nil) (defaults to: nil)

    CodeDeploy supports the deployment to multiple load balancers.

  • on_premise_instance_tags (AWSCDK::CodeDeploy::InstanceTagSet, nil) (defaults to: nil)

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

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The service Role of this Deployment Group.

  • termination_hook (Boolean, nil) (defaults to: nil)

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



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'code_deploy/server_deployment_group_props.rb', line 22

def initialize(alarms: nil, application: nil, auto_rollback: nil, auto_scaling_groups: nil, deployment_config: nil, deployment_group_name: nil, ec2_instance_tags: nil, ignore_alarm_configuration: nil, ignore_poll_alarms_failure: nil, install_agent: nil, load_balancer: nil, load_balancers: nil, on_premise_instance_tags: nil, role: nil, termination_hook: nil)
  @alarms = alarms
  Jsii::Type.check_type(@alarms, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2Nsb3Vkd2F0Y2guSUFsYXJtUmVmIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "alarms") unless @alarms.nil?
  @application = application
  Jsii::Type.check_type(@application, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jb2RlZGVwbG95LklBcHBsaWNhdGlvblJlZiJ9")), "application") unless @application.nil?
  @auto_rollback = auto_rollback.is_a?(Hash) ? ::AWSCDK::CodeDeploy::AutoRollbackConfig.new(**auto_rollback.transform_keys(&:to_sym)) : auto_rollback
  Jsii::Type.check_type(@auto_rollback, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5BdXRvUm9sbGJhY2tDb25maWcifQ==")), "autoRollback") unless @auto_rollback.nil?
  @auto_scaling_groups = auto_scaling_groups
  Jsii::Type.check_type(@auto_scaling_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5JQXV0b1NjYWxpbmdHcm91cCJ9LCJraW5kIjoiYXJyYXkifX0=")), "autoScalingGroups") unless @auto_scaling_groups.nil?
  @deployment_config = deployment_config
  Jsii::Type.check_type(@deployment_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jb2RlZGVwbG95LklEZXBsb3ltZW50Q29uZmlnUmVmIn0=")), "deploymentConfig") unless @deployment_config.nil?
  @deployment_group_name = deployment_group_name
  Jsii::Type.check_type(@deployment_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deploymentGroupName") unless @deployment_group_name.nil?
  @ec2_instance_tags = ec2_instance_tags
  Jsii::Type.check_type(@ec2_instance_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5JbnN0YW5jZVRhZ1NldCJ9")), "ec2InstanceTags") unless @ec2_instance_tags.nil?
  @ignore_alarm_configuration = ignore_alarm_configuration
  Jsii::Type.check_type(@ignore_alarm_configuration, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignoreAlarmConfiguration") unless @ignore_alarm_configuration.nil?
  @ignore_poll_alarms_failure = ignore_poll_alarms_failure
  Jsii::Type.check_type(@ignore_poll_alarms_failure, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignorePollAlarmsFailure") unless @ignore_poll_alarms_failure.nil?
  @install_agent = install_agent
  Jsii::Type.check_type(@install_agent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "installAgent") unless @install_agent.nil?
  @load_balancer = load_balancer
  Jsii::Type.check_type(@load_balancer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5Mb2FkQmFsYW5jZXIifQ==")), "loadBalancer") unless @load_balancer.nil?
  @load_balancers = load_balancers
  Jsii::Type.check_type(@load_balancers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlZGVwbG95LkxvYWRCYWxhbmNlciJ9LCJraW5kIjoiYXJyYXkifX0=")), "loadBalancers") unless @load_balancers.nil?
  @on_premise_instance_tags = on_premise_instance_tags
  Jsii::Type.check_type(@on_premise_instance_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5JbnN0YW5jZVRhZ1NldCJ9")), "onPremiseInstanceTags") unless @on_premise_instance_tags.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @termination_hook = termination_hook
  Jsii::Type.check_type(@termination_hook, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "terminationHook") unless @termination_hook.nil?
end

Instance Attribute Details

#alarmsArray<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>? (readonly)

Note:

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.



65
66
67
# File 'code_deploy/server_deployment_group_props.rb', line 65

def alarms
  @alarms
end

#applicationAWSCDK::Interfaces::AWSCodedeploy::IApplicationRef? (readonly)

Note:

Default: - A new Application will be created.

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



70
71
72
# File 'code_deploy/server_deployment_group_props.rb', line 70

def application
  @application
end

#auto_rollbackAWSCDK::CodeDeploy::AutoRollbackConfig? (readonly)

Note:

Default: - default AutoRollbackConfig.

The auto-rollback configuration for this Deployment Group.



75
76
77
# File 'code_deploy/server_deployment_group_props.rb', line 75

def auto_rollback
  @auto_rollback
end

#auto_scaling_groupsArray<AWSCDK::Autoscaling::IAutoScalingGroup>? (readonly)

Note:

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.



86
87
88
# File 'code_deploy/server_deployment_group_props.rb', line 86

def auto_scaling_groups
  @auto_scaling_groups
end

#deployment_configAWSCDK::Interfaces::AWSCodedeploy::IDeploymentConfigRef? (readonly)

Note:

Default: ServerDeploymentConfig#OneAtATime

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



91
92
93
# File 'code_deploy/server_deployment_group_props.rb', line 91

def deployment_config
  @deployment_config
end

#deployment_group_nameString? (readonly)

Note:

Default: - An auto-generated name will be used.

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

Returns:

  • (String, nil)


96
97
98
# File 'code_deploy/server_deployment_group_props.rb', line 96

def deployment_group_name
  @deployment_group_name
end

#ec2_instance_tagsAWSCDK::CodeDeploy::InstanceTagSet? (readonly)

Note:

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.



101
102
103
# File 'code_deploy/server_deployment_group_props.rb', line 101

def ec2_instance_tags
  @ec2_instance_tags
end

#ignore_alarm_configurationBoolean? (readonly)

Note:

Default: - false

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

Returns:

  • (Boolean, nil)


106
107
108
# File 'code_deploy/server_deployment_group_props.rb', line 106

def ignore_alarm_configuration
  @ignore_alarm_configuration
end

#ignore_poll_alarms_failureBoolean? (readonly)

Note:

Default: false

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

Returns:

  • (Boolean, nil)


111
112
113
# File 'code_deploy/server_deployment_group_props.rb', line 111

def ignore_poll_alarms_failure
  @ignore_poll_alarms_failure
end

#install_agentBoolean? (readonly)

Note:

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.



117
118
119
# File 'code_deploy/server_deployment_group_props.rb', line 117

def install_agent
  @install_agent
end

#load_balancerAWSCDK::CodeDeploy::LoadBalancer? (readonly)

Deprecated.
  • Use loadBalancers instead.
Note:

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.



126
127
128
# File 'code_deploy/server_deployment_group_props.rb', line 126

def load_balancer
  @load_balancer
end

#load_balancersArray<AWSCDK::CodeDeploy::LoadBalancer>? (readonly)

Note:

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.

Returns:



134
135
136
# File 'code_deploy/server_deployment_group_props.rb', line 134

def load_balancers
  @load_balancers
end

#on_premise_instance_tagsAWSCDK::CodeDeploy::InstanceTagSet? (readonly)

Note:

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.



139
140
141
# File 'code_deploy/server_deployment_group_props.rb', line 139

def on_premise_instance_tags
  @on_premise_instance_tags
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A new Role will be created.

The service Role of this Deployment Group.

Returns:



144
145
146
# File 'code_deploy/server_deployment_group_props.rb', line 144

def role
  @role
end

#termination_hookBoolean? (readonly)

Note:

Default: - false

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



150
151
152
# File 'code_deploy/server_deployment_group_props.rb', line 150

def termination_hook
  @termination_hook
end

Class Method Details

.jsii_propertiesObject



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'code_deploy/server_deployment_group_props.rb', line 152

def self.jsii_properties
  {
    :alarms => "alarms",
    :application => "application",
    :auto_rollback => "autoRollback",
    :auto_scaling_groups => "autoScalingGroups",
    :deployment_config => "deploymentConfig",
    :deployment_group_name => "deploymentGroupName",
    :ec2_instance_tags => "ec2InstanceTags",
    :ignore_alarm_configuration => "ignoreAlarmConfiguration",
    :ignore_poll_alarms_failure => "ignorePollAlarmsFailure",
    :install_agent => "installAgent",
    :load_balancer => "loadBalancer",
    :load_balancers => "loadBalancers",
    :on_premise_instance_tags => "onPremiseInstanceTags",
    :role => "role",
    :termination_hook => "terminationHook",
  }
end

Instance Method Details

#to_jsiiObject



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'code_deploy/server_deployment_group_props.rb', line 172

def to_jsii
  result = {}
  result.merge!({
    "alarms" => @alarms,
    "application" => @application,
    "autoRollback" => @auto_rollback,
    "autoScalingGroups" => @auto_scaling_groups,
    "deploymentConfig" => @deployment_config,
    "deploymentGroupName" => @deployment_group_name,
    "ec2InstanceTags" => @ec2_instance_tags,
    "ignoreAlarmConfiguration" => @ignore_alarm_configuration,
    "ignorePollAlarmsFailure" => @ignore_poll_alarms_failure,
    "installAgent" => @install_agent,
    "loadBalancer" => @load_balancer,
    "loadBalancers" => @load_balancers,
    "onPremiseInstanceTags" => @on_premise_instance_tags,
    "role" => @role,
    "terminationHook" => @termination_hook,
  })
  result.compact
end