Class: AWSCDK::EKS::AutoScalingGroupOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::AutoScalingGroupOptions
- Defined in:
- eks/auto_scaling_group_options.rb
Overview
Options for adding an AutoScalingGroup as capacity.
Instance Attribute Summary collapse
-
#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::EKS::BootstrapOptions?
readonly
Allows options for node bootstrapping through EC2 user data.
-
#machine_image_type ⇒ AWSCDK::EKS::MachineImageType?
readonly
Allow options to specify different machine image type.
-
#map_role ⇒ Boolean?
readonly
Will automatically update the aws-auth ConfigMap to map the IAM instance role to RBAC.
-
#spot_interrupt_handler ⇒ Boolean?
readonly
Installs the AWS spot instance interrupt handler on the cluster if it's not already added.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil, map_role: nil, spot_interrupt_handler: nil) ⇒ AutoScalingGroupOptions
constructor
A new instance of AutoScalingGroupOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil, map_role: nil, spot_interrupt_handler: nil) ⇒ AutoScalingGroupOptions
Returns a new instance of AutoScalingGroupOptions.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'eks/auto_scaling_group_options.rb', line 12 def initialize(bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil, map_role: nil, spot_interrupt_handler: nil) @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::EKS::BootstrapOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@bootstrap_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkJvb3RzdHJhcE9wdGlvbnMifQ==")), "bootstrapOptions") unless @bootstrap_options.nil? @machine_image_type = machine_image_type Jsii::Type.check_type(@machine_image_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLk1hY2hpbmVJbWFnZVR5cGUifQ==")), "machineImageType") unless @machine_image_type.nil? @map_role = map_role Jsii::Type.check_type(@map_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mapRole") unless @map_role.nil? @spot_interrupt_handler = spot_interrupt_handler Jsii::Type.check_type(@spot_interrupt_handler, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "spotInterruptHandler") unless @spot_interrupt_handler.nil? end |
Instance Attribute Details
#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().
32 33 34 |
# File 'eks/auto_scaling_group_options.rb', line 32 def bootstrap_enabled @bootstrap_enabled end |
#bootstrap_options ⇒ AWSCDK::EKS::BootstrapOptions? (readonly)
Default: - default options
Allows options for node bootstrapping through EC2 user data.
37 38 39 |
# File 'eks/auto_scaling_group_options.rb', line 37 def @bootstrap_options end |
#machine_image_type ⇒ AWSCDK::EKS::MachineImageType? (readonly)
Default: MachineImageType.AMAZON_LINUX_2
Allow options to specify different machine image type.
42 43 44 |
# File 'eks/auto_scaling_group_options.rb', line 42 def machine_image_type @machine_image_type end |
#map_role ⇒ Boolean? (readonly)
Default: - true if the cluster has kubectl enabled (which is the default).
Will automatically update the aws-auth ConfigMap to map the IAM instance role to RBAC.
This cannot be explicitly set to true if the cluster has kubectl disabled.
49 50 51 |
# File 'eks/auto_scaling_group_options.rb', line 49 def map_role @map_role end |
#spot_interrupt_handler ⇒ Boolean? (readonly)
Default: true
Installs the AWS spot instance interrupt handler on the cluster if it's not already added.
Only relevant if spot_price is configured on the auto-scaling group.
56 57 58 |
# File 'eks/auto_scaling_group_options.rb', line 56 def spot_interrupt_handler @spot_interrupt_handler end |
Class Method Details
.jsii_properties ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'eks/auto_scaling_group_options.rb', line 58 def self.jsii_properties { :bootstrap_enabled => "bootstrapEnabled", :bootstrap_options => "bootstrapOptions", :machine_image_type => "machineImageType", :map_role => "mapRole", :spot_interrupt_handler => "spotInterruptHandler", } end |
Instance Method Details
#to_jsii ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'eks/auto_scaling_group_options.rb', line 68 def to_jsii result = {} result.merge!({ "bootstrapEnabled" => @bootstrap_enabled, "bootstrapOptions" => @bootstrap_options, "machineImageType" => @machine_image_type, "mapRole" => @map_role, "spotInterruptHandler" => @spot_interrupt_handler, }) result.compact end |