Class: AWSCDK::CodeDeploy::ServerDeploymentGroupProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CodeDeploy::ServerDeploymentGroupProps
- Defined in:
- code_deploy/server_deployment_group_props.rb
Overview
Construction properties for ServerDeploymentGroup.
Instance Attribute Summary collapse
-
#alarms ⇒ Array<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>?
readonly
The CloudWatch alarms associated with this Deployment Group.
-
#application ⇒ AWSCDK::Interfaces::AWSCodedeploy::IApplicationRef?
readonly
The CodeDeploy EC2/on-premise Application this Deployment Group belongs to.
-
#auto_rollback ⇒ AWSCDK::CodeDeploy::AutoRollbackConfig?
readonly
The auto-rollback configuration for this Deployment Group.
-
#auto_scaling_groups ⇒ Array<AWSCDK::Autoscaling::IAutoScalingGroup>?
readonly
The auto-scaling groups belonging to this Deployment Group.
-
#deployment_config ⇒ AWSCDK::Interfaces::AWSCodedeploy::IDeploymentConfigRef?
readonly
The EC2/on-premise Deployment Configuration to use for this Deployment Group.
-
#deployment_group_name ⇒ String?
readonly
The physical, human-readable name of the CodeDeploy Deployment Group.
-
#ec2_instance_tags ⇒ AWSCDK::CodeDeploy::InstanceTagSet?
readonly
All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.
-
#ignore_alarm_configuration ⇒ Boolean?
readonly
Whether to skip the step of checking CloudWatch alarms during the deployment process.
-
#ignore_poll_alarms_failure ⇒ Boolean?
readonly
Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.
-
#install_agent ⇒ Boolean?
readonly
If you've provided any auto-scaling groups with the
#autoScalingGroupsproperty, you can set this property to add User Data that installs the CodeDeploy agent on the instances. -
#load_balancer ⇒ AWSCDK::CodeDeploy::LoadBalancer?
readonly
deprecated
Deprecated.
- Use
loadBalancersinstead.
- Use
-
#load_balancers ⇒ Array<AWSCDK::CodeDeploy::LoadBalancer>?
readonly
CodeDeploy supports the deployment to multiple load balancers.
-
#on_premise_instance_tags ⇒ AWSCDK::CodeDeploy::InstanceTagSet?
readonly
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?
readonly
The service Role of this Deployment Group.
-
#termination_hook ⇒ Boolean?
readonly
Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of ServerDeploymentGroupProps.
- #to_jsii ⇒ Object
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.
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 = 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 = 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
#alarms ⇒ Array<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>? (readonly)
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 |
#application ⇒ AWSCDK::Interfaces::AWSCodedeploy::IApplicationRef? (readonly)
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_rollback ⇒ AWSCDK::CodeDeploy::AutoRollbackConfig? (readonly)
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_groups ⇒ Array<AWSCDK::Autoscaling::IAutoScalingGroup>? (readonly)
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_config ⇒ AWSCDK::Interfaces::AWSCodedeploy::IDeploymentConfigRef? (readonly)
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_name ⇒ String? (readonly)
Default: - An auto-generated name will be used.
The physical, human-readable name of the CodeDeploy Deployment Group.
96 97 98 |
# File 'code_deploy/server_deployment_group_props.rb', line 96 def deployment_group_name @deployment_group_name end |
#ec2_instance_tags ⇒ AWSCDK::CodeDeploy::InstanceTagSet? (readonly)
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 end |
#ignore_alarm_configuration ⇒ Boolean? (readonly)
Default: - false
Whether to skip the step of checking CloudWatch alarms during the deployment process.
106 107 108 |
# File 'code_deploy/server_deployment_group_props.rb', line 106 def ignore_alarm_configuration @ignore_alarm_configuration end |
#ignore_poll_alarms_failure ⇒ Boolean? (readonly)
Default: false
Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.
111 112 113 |
# File 'code_deploy/server_deployment_group_props.rb', line 111 def ignore_poll_alarms_failure @ignore_poll_alarms_failure end |
#install_agent ⇒ Boolean? (readonly)
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_balancer ⇒ AWSCDK::CodeDeploy::LoadBalancer? (readonly)
- Use
loadBalancersinstead.
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_balancers ⇒ Array<AWSCDK::CodeDeploy::LoadBalancer>? (readonly)
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.
134 135 136 |
# File 'code_deploy/server_deployment_group_props.rb', line 134 def load_balancers @load_balancers end |
#on_premise_instance_tags ⇒ AWSCDK::CodeDeploy::InstanceTagSet? (readonly)
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 end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A new Role will be created.
The service Role of this Deployment Group.
144 145 146 |
# File 'code_deploy/server_deployment_group_props.rb', line 144 def role @role end |
#termination_hook ⇒ Boolean? (readonly)
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_properties ⇒ Object
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_jsii ⇒ Object
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 |