Class: AWSCDK::Autoscaling::CfnAutoScalingGroup::InstanceMaintenancePolicyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/cfn_auto_scaling_group.rb

Overview

InstanceMaintenancePolicy is a property of the AWS::AutoScaling::AutoScalingGroup resource.

For more information, see Instance maintenance policies in the Amazon EC2 Auto Scaling User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_healthy_percentage: nil, min_healthy_percentage: nil) ⇒ InstanceMaintenancePolicyProperty

Returns a new instance of InstanceMaintenancePolicyProperty.

Parameters:

  • max_healthy_percentage (Numeric, nil) (defaults to: nil)

    Specifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group.

  • min_healthy_percentage (Numeric, nil) (defaults to: nil)

    Specifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group.



1434
1435
1436
1437
1438
1439
# File 'autoscaling/cfn_auto_scaling_group.rb', line 1434

def initialize(max_healthy_percentage: nil, min_healthy_percentage: nil)
  @max_healthy_percentage = max_healthy_percentage
  Jsii::Type.check_type(@max_healthy_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxHealthyPercentage") unless @max_healthy_percentage.nil?
  @min_healthy_percentage = min_healthy_percentage
  Jsii::Type.check_type(@min_healthy_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minHealthyPercentage") unless @min_healthy_percentage.nil?
end

Instance Attribute Details

#max_healthy_percentageNumeric? (readonly)

Specifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group.

It represents the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. Value range is 100 to 200. To clear a previously set value, specify a value of -1 .

Both MinHealthyPercentage and MaxHealthyPercentage must be specified, and the difference between them cannot be greater than 100. A large range increases the number of instances that can be replaced at the same time.



1449
1450
1451
# File 'autoscaling/cfn_auto_scaling_group.rb', line 1449

def max_healthy_percentage
  @max_healthy_percentage
end

#min_healthy_percentageNumeric? (readonly)

Specifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group.

It represents the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload when replacing instances. Value range is 0 to 100. To clear a previously set value, specify a value of -1 .



1456
1457
1458
# File 'autoscaling/cfn_auto_scaling_group.rb', line 1456

def min_healthy_percentage
  @min_healthy_percentage
end

Class Method Details

.jsii_propertiesObject



1458
1459
1460
1461
1462
1463
# File 'autoscaling/cfn_auto_scaling_group.rb', line 1458

def self.jsii_properties
  {
    :max_healthy_percentage => "maxHealthyPercentage",
    :min_healthy_percentage => "minHealthyPercentage",
  }
end

Instance Method Details

#to_jsiiObject



1465
1466
1467
1468
1469
1470
1471
1472
# File 'autoscaling/cfn_auto_scaling_group.rb', line 1465

def to_jsii
  result = {}
  result.merge!({
    "maxHealthyPercentage" => @max_healthy_percentage,
    "minHealthyPercentage" => @min_healthy_percentage,
  })
  result.compact
end