Class: AWSCDK::EKSv2::AutoScalingGroupCapacityOptions
- Inherits:
-
Autoscaling::CommonAutoScalingGroupProps
- Object
- Autoscaling::CommonAutoScalingGroupProps
- AWSCDK::EKSv2::AutoScalingGroupCapacityOptions
- Defined in:
- ek_sv2/auto_scaling_group_capacity_options.rb
Overview
Options for adding worker nodes.
Instance Attribute Summary collapse
-
#allow_all_outbound ⇒ Boolean?
readonly
Whether the instances can initiate connections to anywhere by default.
-
#associate_public_ip_address ⇒ Boolean?
readonly
Whether instances in the Auto Scaling Group should have public IP addresses associated with them.
-
#auto_scaling_group_name ⇒ String?
readonly
The name of the Auto Scaling group.
-
#az_capacity_distribution_strategy ⇒ AWSCDK::Autoscaling::CapacityDistributionStrategy?
readonly
The strategy for distributing instances across Availability Zones.
-
#block_devices ⇒ Array<AWSCDK::Autoscaling::BlockDevice>?
readonly
Specifies how block devices are exposed to the instance.
-
#bootstrap_enabled ⇒ Boolean?
readonly
Configures the EC2 user-data script for instances in this autoscaling group to bootstrap the node (invoke
/etc/eks/bootstrap.sh) and associate it with the EKS cluster. -
#bootstrap_options ⇒ AWSCDK::EKSv2::BootstrapOptions?
readonly
EKS node bootstrapping options.
-
#capacity_rebalance ⇒ Boolean?
readonly
Indicates whether Capacity Rebalancing is enabled.
-
#cooldown ⇒ AWSCDK::Duration?
readonly
Default scaling cooldown for this AutoScalingGroup.
-
#default_instance_warmup ⇒ AWSCDK::Duration?
readonly
The amount of time, in seconds, until a newly launched instance can contribute to the Amazon CloudWatch metrics.
-
#deletion_protection ⇒ AWSCDK::Autoscaling::DeletionProtection?
readonly
Deletion protection for the Auto Scaling group.
-
#desired_capacity ⇒ Numeric?
readonly
Initial amount of instances in the fleet.
-
#group_metrics ⇒ Array<AWSCDK::Autoscaling::GroupMetrics>?
readonly
Enable monitoring for group metrics, these metrics describe the group rather than any of its instances.
-
#health_check ⇒ AWSCDK::Autoscaling::HealthCheck?
readonly
deprecated
Deprecated.
Use
healthChecksinstead -
#health_checks ⇒ AWSCDK::Autoscaling::HealthChecks?
readonly
Configuration for EC2 or additional health checks.
-
#ignore_unmodified_size_properties ⇒ Boolean?
readonly
If the ASG has scheduled actions, don't reset unchanged group sizes.
-
#instance_lifecycle_policy ⇒ AWSCDK::Autoscaling::InstanceLifecyclePolicy?
readonly
An instance lifecycle policy that defines how instances should be handled during lifecycle events, particularly when lifecycle hooks are abandoned or fail.
-
#instance_monitoring ⇒ AWSCDK::Autoscaling::Monitoring?
readonly
Controls whether instances in this group are launched with detailed or basic monitoring.
-
#instance_type ⇒ AWSCDK::EC2::InstanceType
readonly
Instance type of the instances to start.
- #key_name ⇒ String? readonly deprecated Deprecated.
-
#key_pair ⇒ AWSCDK::EC2::IKeyPair?
readonly
The SSH keypair to grant access to the instance.
-
#machine_image_type ⇒ AWSCDK::EKSv2::MachineImageType?
readonly
Machine image type.
-
#max_capacity ⇒ Numeric?
readonly
Maximum number of instances in the fleet.
-
#max_instance_lifetime ⇒ AWSCDK::Duration?
readonly
The maximum amount of time that an instance can be in service.
-
#min_capacity ⇒ Numeric?
readonly
Minimum number of instances in the fleet.
-
#new_instances_protected_from_scale_in ⇒ Boolean?
readonly
Whether newly-launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
-
#notifications ⇒ Array<AWSCDK::Autoscaling::NotificationConfiguration>?
readonly
Configure autoscaling group to send notifications about fleet changes to an SNS topic(s).
-
#signals ⇒ AWSCDK::Autoscaling::Signals?
readonly
Configure waiting for signals during deployment.
-
#spot_price ⇒ String?
readonly
The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request.
-
#ssm_session_permissions ⇒ Boolean?
readonly
Add SSM session permissions to the instance role.
-
#termination_policies ⇒ Array<AWSCDK::Autoscaling::TerminationPolicy>?
readonly
A policy or a list of policies that are used to select the instances to terminate.
-
#termination_policy_custom_lambda_function_arn ⇒ String?
readonly
A lambda function Arn that can be used as a custom termination policy to select the instances to terminate.
-
#update_policy ⇒ AWSCDK::Autoscaling::UpdatePolicy?
readonly
What to do when an AutoScalingGroup's instance configuration is changed.
-
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection?
readonly
Where to place instances within the VPC.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(allow_all_outbound: nil, associate_public_ip_address: nil, auto_scaling_group_name: nil, az_capacity_distribution_strategy: nil, block_devices: nil, capacity_rebalance: nil, cooldown: nil, default_instance_warmup: nil, deletion_protection: nil, desired_capacity: nil, group_metrics: nil, health_check: nil, health_checks: nil, ignore_unmodified_size_properties: nil, instance_lifecycle_policy: nil, instance_monitoring: nil, key_name: nil, key_pair: nil, max_capacity: nil, max_instance_lifetime: nil, min_capacity: nil, new_instances_protected_from_scale_in: nil, notifications: nil, signals: nil, spot_price: nil, ssm_session_permissions: nil, termination_policies: nil, termination_policy_custom_lambda_function_arn: nil, update_policy: nil, vpc_subnets: nil, instance_type:, bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil) ⇒ AutoScalingGroupCapacityOptions
constructor
A new instance of AutoScalingGroupCapacityOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(allow_all_outbound: nil, associate_public_ip_address: nil, auto_scaling_group_name: nil, az_capacity_distribution_strategy: nil, block_devices: nil, capacity_rebalance: nil, cooldown: nil, default_instance_warmup: nil, deletion_protection: nil, desired_capacity: nil, group_metrics: nil, health_check: nil, health_checks: nil, ignore_unmodified_size_properties: nil, instance_lifecycle_policy: nil, instance_monitoring: nil, key_name: nil, key_pair: nil, max_capacity: nil, max_instance_lifetime: nil, min_capacity: nil, new_instances_protected_from_scale_in: nil, notifications: nil, signals: nil, spot_price: nil, ssm_session_permissions: nil, termination_policies: nil, termination_policy_custom_lambda_function_arn: nil, update_policy: nil, vpc_subnets: nil, instance_type:, bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil) ⇒ AutoScalingGroupCapacityOptions
Returns a new instance of AutoScalingGroupCapacityOptions.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 41 def initialize(allow_all_outbound: nil, associate_public_ip_address: nil, auto_scaling_group_name: nil, az_capacity_distribution_strategy: nil, block_devices: nil, capacity_rebalance: nil, cooldown: nil, default_instance_warmup: nil, deletion_protection: nil, desired_capacity: nil, group_metrics: nil, health_check: nil, health_checks: nil, ignore_unmodified_size_properties: nil, instance_lifecycle_policy: nil, instance_monitoring: nil, key_name: nil, key_pair: nil, max_capacity: nil, max_instance_lifetime: nil, min_capacity: nil, new_instances_protected_from_scale_in: nil, notifications: nil, signals: nil, spot_price: nil, ssm_session_permissions: nil, termination_policies: nil, termination_policy_custom_lambda_function_arn: nil, update_policy: nil, vpc_subnets: nil, instance_type:, bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil) @allow_all_outbound = allow_all_outbound Jsii::Type.check_type(@allow_all_outbound, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowAllOutbound") unless @allow_all_outbound.nil? @associate_public_ip_address = associate_public_ip_address Jsii::Type.check_type(@associate_public_ip_address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "associatePublicIpAddress") unless @associate_public_ip_address.nil? @auto_scaling_group_name = auto_scaling_group_name Jsii::Type.check_type(@auto_scaling_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "autoScalingGroupName") unless @auto_scaling_group_name.nil? @az_capacity_distribution_strategy = az_capacity_distribution_strategy Jsii::Type.check_type(@az_capacity_distribution_strategy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQ2FwYWNpdHlEaXN0cmlidXRpb25TdHJhdGVneSJ9")), "azCapacityDistributionStrategy") unless @az_capacity_distribution_strategy.nil? @block_devices = block_devices.is_a?(Array) ? block_devices.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Autoscaling::BlockDevice.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : block_devices Jsii::Type.check_type(@block_devices, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5CbG9ja0RldmljZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "blockDevices") unless @block_devices.nil? @capacity_rebalance = capacity_rebalance Jsii::Type.check_type(@capacity_rebalance, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "capacityRebalance") unless @capacity_rebalance.nil? @cooldown = cooldown Jsii::Type.check_type(@cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "cooldown") unless @cooldown.nil? @default_instance_warmup = default_instance_warmup Jsii::Type.check_type(@default_instance_warmup, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "defaultInstanceWarmup") unless @default_instance_warmup.nil? @deletion_protection = deletion_protection Jsii::Type.check_type(@deletion_protection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuRGVsZXRpb25Qcm90ZWN0aW9uIn0=")), "deletionProtection") unless @deletion_protection.nil? @desired_capacity = desired_capacity Jsii::Type.check_type(@desired_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredCapacity") unless @desired_capacity.nil? @group_metrics = group_metrics Jsii::Type.check_type(@group_metrics, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5Hcm91cE1ldHJpY3MifSwia2luZCI6ImFycmF5In19")), "groupMetrics") unless @group_metrics.nil? @health_check = health_check Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuSGVhbHRoQ2hlY2sifQ==")), "healthCheck") unless @health_check.nil? @health_checks = health_checks Jsii::Type.check_type(@health_checks, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuSGVhbHRoQ2hlY2tzIn0=")), "healthChecks") unless @health_checks.nil? @ignore_unmodified_size_properties = ignore_unmodified_size_properties Jsii::Type.check_type(@ignore_unmodified_size_properties, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignoreUnmodifiedSizeProperties") unless @ignore_unmodified_size_properties.nil? @instance_lifecycle_policy = instance_lifecycle_policy.is_a?(Hash) ? ::AWSCDK::Autoscaling::InstanceLifecyclePolicy.new(**instance_lifecycle_policy.transform_keys(&:to_sym)) : instance_lifecycle_policy Jsii::Type.check_type(@instance_lifecycle_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuSW5zdGFuY2VMaWZlY3ljbGVQb2xpY3kifQ==")), "instanceLifecyclePolicy") unless @instance_lifecycle_policy.nil? @instance_monitoring = instance_monitoring Jsii::Type.check_type(@instance_monitoring, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTW9uaXRvcmluZyJ9")), "instanceMonitoring") unless @instance_monitoring.nil? @key_name = key_name Jsii::Type.check_type(@key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyName") unless @key_name.nil? @key_pair = key_pair Jsii::Type.check_type(@key_pair, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklLZXlQYWlyIn0=")), "keyPair") unless @key_pair.nil? @max_capacity = max_capacity Jsii::Type.check_type(@max_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCapacity") unless @max_capacity.nil? @max_instance_lifetime = max_instance_lifetime Jsii::Type.check_type(@max_instance_lifetime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxInstanceLifetime") unless @max_instance_lifetime.nil? @min_capacity = min_capacity Jsii::Type.check_type(@min_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minCapacity") unless @min_capacity.nil? @new_instances_protected_from_scale_in = new_instances_protected_from_scale_in Jsii::Type.check_type(@new_instances_protected_from_scale_in, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "newInstancesProtectedFromScaleIn") unless @new_instances_protected_from_scale_in.nil? @notifications = notifications.is_a?(Array) ? notifications.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Autoscaling::NotificationConfiguration.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : notifications Jsii::Type.check_type(@notifications, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5Ob3RpZmljYXRpb25Db25maWd1cmF0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "notifications") unless @notifications.nil? @signals = signals Jsii::Type.check_type(@signals, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2lnbmFscyJ9")), "signals") unless @signals.nil? @spot_price = spot_price Jsii::Type.check_type(@spot_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "spotPrice") unless @spot_price.nil? @ssm_session_permissions = Jsii::Type.check_type(@ssm_session_permissions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ssmSessionPermissions") unless @ssm_session_permissions.nil? @termination_policies = termination_policies Jsii::Type.check_type(@termination_policies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5UZXJtaW5hdGlvblBvbGljeSJ9LCJraW5kIjoiYXJyYXkifX0=")), "terminationPolicies") unless @termination_policies.nil? @termination_policy_custom_lambda_function_arn = termination_policy_custom_lambda_function_arn Jsii::Type.check_type(@termination_policy_custom_lambda_function_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "terminationPolicyCustomLambdaFunctionArn") unless @termination_policy_custom_lambda_function_arn.nil? @update_policy = update_policy Jsii::Type.check_type(@update_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuVXBkYXRlUG9saWN5In0=")), "updatePolicy") unless @update_policy.nil? @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil? @instance_type = instance_type Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType") @bootstrap_enabled = bootstrap_enabled Jsii::Type.check_type(@bootstrap_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "bootstrapEnabled") unless @bootstrap_enabled.nil? @bootstrap_options = .is_a?(Hash) ? ::AWSCDK::EKSv2::BootstrapOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@bootstrap_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkJvb3RzdHJhcE9wdGlvbnMifQ==")), "bootstrapOptions") unless @bootstrap_options.nil? @machine_image_type = machine_image_type Jsii::Type.check_type(@machine_image_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLk1hY2hpbmVJbWFnZVR5cGUifQ==")), "machineImageType") unless @machine_image_type.nil? end |
Instance Attribute Details
#allow_all_outbound ⇒ Boolean? (readonly)
Default: true
Whether the instances can initiate connections to anywhere by default.
116 117 118 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 116 def allow_all_outbound @allow_all_outbound end |
#associate_public_ip_address ⇒ Boolean? (readonly)
Default: - Use subnet setting.
Whether instances in the Auto Scaling Group should have public IP addresses associated with them.
launch_template and mixed_instances_policy must not be specified when this property is specified
123 124 125 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 123 def associate_public_ip_address @associate_public_ip_address end |
#auto_scaling_group_name ⇒ String? (readonly)
Default: - Auto generated by CloudFormation
The name of the Auto Scaling group.
This name must be unique per Region per account.
130 131 132 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 130 def auto_scaling_group_name @auto_scaling_group_name end |
#az_capacity_distribution_strategy ⇒ AWSCDK::Autoscaling::CapacityDistributionStrategy? (readonly)
Default: None
The strategy for distributing instances across Availability Zones.
135 136 137 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 135 def az_capacity_distribution_strategy @az_capacity_distribution_strategy end |
#block_devices ⇒ Array<AWSCDK::Autoscaling::BlockDevice>? (readonly)
Default: - Uses the block device mapping of the AMI
Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes.
Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.
launch_template and mixed_instances_policy must not be specified when this property is specified
148 149 150 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 148 def block_devices @block_devices end |
#bootstrap_enabled ⇒ Boolean? (readonly)
Default: true
Configures the EC2 user-data script for instances in this autoscaling group to bootstrap the node (invoke /etc/eks/bootstrap.sh) and associate it with the EKS cluster.
If you wish to provide a custom user data script, set this to false and
manually invoke autoscalingGroup.addUserData().
398 399 400 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 398 def bootstrap_enabled @bootstrap_enabled end |
#bootstrap_options ⇒ AWSCDK::EKSv2::BootstrapOptions? (readonly)
Default: - none
EKS node bootstrapping options.
403 404 405 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 403 def @bootstrap_options end |
#capacity_rebalance ⇒ Boolean? (readonly)
Default: false
Indicates whether Capacity Rebalancing is enabled.
When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance.
158 159 160 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 158 def capacity_rebalance @capacity_rebalance end |
#cooldown ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(5)
Default scaling cooldown for this AutoScalingGroup.
163 164 165 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 163 def cooldown @cooldown end |
#default_instance_warmup ⇒ AWSCDK::Duration? (readonly)
Default: None
The amount of time, in seconds, until a newly launched instance can contribute to the Amazon CloudWatch metrics.
This delay lets an instance finish initializing before Amazon EC2 Auto Scaling aggregates instance metrics, resulting in more reliable usage data. Set this value equal to the amount of time that it takes for resource consumption to become stable after an instance reaches the InService state.
To optimize the performance of scaling policies that scale continuously, such as target tracking and step scaling policies, we strongly recommend that you enable the default instance warmup, even if its value is set to 0 seconds
Default instance warmup will not be added if no value is specified
178 179 180 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 178 def default_instance_warmup @default_instance_warmup end |
#deletion_protection ⇒ AWSCDK::Autoscaling::DeletionProtection? (readonly)
Default: DeletionProtection.NONE
Deletion protection for the Auto Scaling group.
184 185 186 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 184 def deletion_protection @deletion_protection end |
#desired_capacity ⇒ Numeric? (readonly)
Default: minCapacity, and leave unchanged during deployment
Initial amount of instances in the fleet.
If this is set to a number, every deployment will reset the amount of instances to this number. It is recommended to leave this value blank.
193 194 195 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 193 def desired_capacity @desired_capacity end |
#group_metrics ⇒ Array<AWSCDK::Autoscaling::GroupMetrics>? (readonly)
Default: - no group metrics will be reported
Enable monitoring for group metrics, these metrics describe the group rather than any of its instances.
To report all group metrics use GroupMetrics.all()
Group metrics are reported in a granularity of 1 minute at no additional charge.
201 202 203 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 201 def group_metrics @group_metrics end |
#health_check ⇒ AWSCDK::Autoscaling::HealthCheck? (readonly)
Use healthChecks instead
Default: - HealthCheck.ec2 with no grace period
Configuration for health checks.
207 208 209 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 207 def health_check @health_check end |
#health_checks ⇒ AWSCDK::Autoscaling::HealthChecks? (readonly)
Default: - EC2 type with no grace period
Configuration for EC2 or additional health checks.
Even when using HealthChecks.withAdditionalChecks(), the EC2 type is implicitly included.
215 216 217 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 215 def health_checks @health_checks end |
#ignore_unmodified_size_properties ⇒ Boolean? (readonly)
Default: true
If the ASG has scheduled actions, don't reset unchanged group sizes.
Only used if the ASG has scheduled actions (which may scale your ASG up or down regardless of cdk deployments). If true, the size of the group will only be reset if it has been changed in the CDK app. If false, the sizes will always be changed back to what they were in the CDK app on deployment.
226 227 228 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 226 def ignore_unmodified_size_properties @ignore_unmodified_size_properties end |
#instance_lifecycle_policy ⇒ AWSCDK::Autoscaling::InstanceLifecyclePolicy? (readonly)
Default: None
An instance lifecycle policy that defines how instances should be handled during lifecycle events, particularly when lifecycle hooks are abandoned or fail.
232 233 234 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 232 def instance_lifecycle_policy @instance_lifecycle_policy end |
#instance_monitoring ⇒ AWSCDK::Autoscaling::Monitoring? (readonly)
Default: - Monitoring.DETAILED
Controls whether instances in this group are launched with detailed or basic monitoring.
When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes.
launch_template and mixed_instances_policy must not be specified when this property is specified
243 244 245 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 243 def instance_monitoring @instance_monitoring end |
#instance_type ⇒ AWSCDK::EC2::InstanceType (readonly)
Instance type of the instances to start.
390 391 392 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 390 def instance_type @instance_type end |
#key_name ⇒ String? (readonly)
Default: - No SSH access will be possible.
Name of SSH keypair to grant access to instances.
launch_template and mixed_instances_policy must not be specified when this property is specified
You can either specify key_pair or key_name, not both.
253 254 255 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 253 def key_name @key_name end |
#key_pair ⇒ AWSCDK::EC2::IKeyPair? (readonly)
Default: - No SSH access will be possible.
The SSH keypair to grant access to the instance.
Feature flag AUTOSCALING_GENERATE_LAUNCH_TEMPLATE must be enabled to use this property.
launch_template and mixed_instances_policy must not be specified when this property is specified.
You can either specify key_pair or key_name, not both.
264 265 266 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 264 def key_pair @key_pair end |
#machine_image_type ⇒ AWSCDK::EKSv2::MachineImageType? (readonly)
Default: MachineImageType.AMAZON_LINUX_2
Machine image type.
408 409 410 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 408 def machine_image_type @machine_image_type end |
#max_capacity ⇒ Numeric? (readonly)
Default: desiredCapacity
Maximum number of instances in the fleet.
269 270 271 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 269 def max_capacity @max_capacity end |
#max_instance_lifetime ⇒ AWSCDK::Duration? (readonly)
Default: none
The maximum amount of time that an instance can be in service.
The maximum duration applies to all current and future instances in the group. As an instance approaches its maximum duration, it is terminated and replaced, and cannot be used again.
You must specify a value of at least 86,400 seconds (one day). To clear a previously set value, leave this property undefined.
282 283 284 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 282 def max_instance_lifetime @max_instance_lifetime end |
#min_capacity ⇒ Numeric? (readonly)
Default: 1
Minimum number of instances in the fleet.
287 288 289 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 287 def min_capacity @min_capacity end |
#new_instances_protected_from_scale_in ⇒ Boolean? (readonly)
Default: false
Whether newly-launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
By default, Auto Scaling can terminate an instance at any time after launch when scaling in an Auto Scaling Group, subject to the group's termination policy. However, you may wish to protect newly-launched instances from being scaled in if they are going to run critical applications that should not be prematurely terminated.
This flag must be enabled if the Auto Scaling Group will be associated with an ECS Capacity Provider with managed termination protection.
301 302 303 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 301 def new_instances_protected_from_scale_in @new_instances_protected_from_scale_in end |
#notifications ⇒ Array<AWSCDK::Autoscaling::NotificationConfiguration>? (readonly)
Default: - No fleet change notifications will be sent.
Configure autoscaling group to send notifications about fleet changes to an SNS topic(s).
307 308 309 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 307 def notifications @notifications end |
#signals ⇒ AWSCDK::Autoscaling::Signals? (readonly)
Default: - Do not wait for signals
Configure waiting for signals during deployment.
Use this to pause the CloudFormation deployment to wait for the instances
in the AutoScalingGroup to report successful startup during
creation and updates. The UserData script needs to invoke cfn-signal
with a success or failure code after it is done setting up the instance.
Without waiting for signals, the CloudFormation deployment will proceed as soon as the AutoScalingGroup has been created or updated but before the instances in the group have been started.
For example, to have instances wait for an Elastic Load Balancing health check before they signal success, add a health-check verification by using the cfn-init helper script. For an example, see the verify_instance_health command in the Auto Scaling rolling updates sample template:
328 329 330 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 328 def signals @signals end |
#spot_price ⇒ String? (readonly)
Default: none
The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request.
Spot Instances are launched when the price you specify exceeds the current Spot market price.
launch_template and mixed_instances_policy must not be specified when this property is specified
338 339 340 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 338 def spot_price @spot_price end |
#ssm_session_permissions ⇒ Boolean? (readonly)
Default: false
Add SSM session permissions to the instance role.
Setting this to true adds the necessary permissions to connect
to the instance using SSM Session Manager. You can do this
from the AWS Console.
NOTE: Setting this flag to true may not be enough by itself.
You must also use an AMI that comes with the SSM Agent, or install
the SSM Agent yourself. See
Working with SSM Agent
in the SSM Developer Guide.
353 354 355 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 353 def @ssm_session_permissions end |
#termination_policies ⇒ Array<AWSCDK::Autoscaling::TerminationPolicy>? (readonly)
Default: - TerminationPolicy.DEFAULT
A policy or a list of policies that are used to select the instances to terminate.
The policies are executed in the order that you list them.
361 362 363 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 361 def termination_policies @termination_policies end |
#termination_policy_custom_lambda_function_arn ⇒ String? (readonly)
Default: - No lambda function Arn will be supplied
A lambda function Arn that can be used as a custom termination policy to select the instances to terminate.
This property must be specified if the TerminationPolicy.CUSTOM_LAMBDA_FUNCTION is used.
370 371 372 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 370 def termination_policy_custom_lambda_function_arn @termination_policy_custom_lambda_function_arn end |
#update_policy ⇒ AWSCDK::Autoscaling::UpdatePolicy? (readonly)
Default: - UpdatePolicy.rollingUpdate() if using init, UpdatePolicy.none() otherwise
What to do when an AutoScalingGroup's instance configuration is changed.
This is applied when any of the settings on the ASG are changed that affect how the instances should be created (VPC, instance type, startup scripts, etc.). It indicates how the existing instances should be replaced with new instances matching the new config. By default, nothing is done and only new instances are launched with the new config.
381 382 383 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 381 def update_policy @update_policy end |
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - All Private subnets.
Where to place instances within the VPC.
386 387 388 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 386 def vpc_subnets @vpc_subnets end |
Class Method Details
.jsii_properties ⇒ Object
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 410 def self.jsii_properties { :allow_all_outbound => "allowAllOutbound", :associate_public_ip_address => "associatePublicIpAddress", :auto_scaling_group_name => "autoScalingGroupName", :az_capacity_distribution_strategy => "azCapacityDistributionStrategy", :block_devices => "blockDevices", :capacity_rebalance => "capacityRebalance", :cooldown => "cooldown", :default_instance_warmup => "defaultInstanceWarmup", :deletion_protection => "deletionProtection", :desired_capacity => "desiredCapacity", :group_metrics => "groupMetrics", :health_check => "healthCheck", :health_checks => "healthChecks", :ignore_unmodified_size_properties => "ignoreUnmodifiedSizeProperties", :instance_lifecycle_policy => "instanceLifecyclePolicy", :instance_monitoring => "instanceMonitoring", :key_name => "keyName", :key_pair => "keyPair", :max_capacity => "maxCapacity", :max_instance_lifetime => "maxInstanceLifetime", :min_capacity => "minCapacity", :new_instances_protected_from_scale_in => "newInstancesProtectedFromScaleIn", :notifications => "notifications", :signals => "signals", :spot_price => "spotPrice", :ssm_session_permissions => "ssmSessionPermissions", :termination_policies => "terminationPolicies", :termination_policy_custom_lambda_function_arn => "terminationPolicyCustomLambdaFunctionArn", :update_policy => "updatePolicy", :vpc_subnets => "vpcSubnets", :instance_type => "instanceType", :bootstrap_enabled => "bootstrapEnabled", :bootstrap_options => "bootstrapOptions", :machine_image_type => "machineImageType", } end |
Instance Method Details
#to_jsii ⇒ Object
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'ek_sv2/auto_scaling_group_capacity_options.rb', line 449 def to_jsii result = {} result.merge!(super) result.merge!({ "allowAllOutbound" => @allow_all_outbound, "associatePublicIpAddress" => @associate_public_ip_address, "autoScalingGroupName" => @auto_scaling_group_name, "azCapacityDistributionStrategy" => @az_capacity_distribution_strategy, "blockDevices" => @block_devices, "capacityRebalance" => @capacity_rebalance, "cooldown" => @cooldown, "defaultInstanceWarmup" => @default_instance_warmup, "deletionProtection" => @deletion_protection, "desiredCapacity" => @desired_capacity, "groupMetrics" => @group_metrics, "healthCheck" => @health_check, "healthChecks" => @health_checks, "ignoreUnmodifiedSizeProperties" => @ignore_unmodified_size_properties, "instanceLifecyclePolicy" => @instance_lifecycle_policy, "instanceMonitoring" => @instance_monitoring, "keyName" => @key_name, "keyPair" => @key_pair, "maxCapacity" => @max_capacity, "maxInstanceLifetime" => @max_instance_lifetime, "minCapacity" => @min_capacity, "newInstancesProtectedFromScaleIn" => @new_instances_protected_from_scale_in, "notifications" => @notifications, "signals" => @signals, "spotPrice" => @spot_price, "ssmSessionPermissions" => @ssm_session_permissions, "terminationPolicies" => @termination_policies, "terminationPolicyCustomLambdaFunctionArn" => @termination_policy_custom_lambda_function_arn, "updatePolicy" => @update_policy, "vpcSubnets" => @vpc_subnets, "instanceType" => @instance_type, "bootstrapEnabled" => @bootstrap_enabled, "bootstrapOptions" => @bootstrap_options, "machineImageType" => @machine_image_type, }) result.compact end |