Class: AWSCDK::EKSv2::AutoScalingGroupOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ek_sv2/auto_scaling_group_options.rb

Overview

Options for adding an AutoScalingGroup as capacity.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil) ⇒ AutoScalingGroupOptions

Returns a new instance of AutoScalingGroupOptions.

Parameters:

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

    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, nil) (defaults to: nil)

    Allows options for node bootstrapping through EC2 user data.

  • machine_image_type (AWSCDK::EKSv2::MachineImageType, nil) (defaults to: nil)

    Allow options to specify different machine image type.



10
11
12
13
14
15
16
17
# File 'ek_sv2/auto_scaling_group_options.rb', line 10

def initialize(bootstrap_enabled: nil, bootstrap_options: nil, machine_image_type: nil)
  @bootstrap_enabled = bootstrap_enabled
  Jsii::Type.check_type(@bootstrap_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "bootstrapEnabled") unless @bootstrap_enabled.nil?
  @bootstrap_options = bootstrap_options.is_a?(Hash) ? ::AWSCDK::EKSv2::BootstrapOptions.new(**bootstrap_options.transform_keys(&:to_sym)) : bootstrap_options
  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

#bootstrap_enabledBoolean? (readonly)

Note:

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().

Returns:

  • (Boolean, nil)


26
27
28
# File 'ek_sv2/auto_scaling_group_options.rb', line 26

def bootstrap_enabled
  @bootstrap_enabled
end

#bootstrap_optionsAWSCDK::EKSv2::BootstrapOptions? (readonly)

Note:

Default: - default options

Allows options for node bootstrapping through EC2 user data.



31
32
33
# File 'ek_sv2/auto_scaling_group_options.rb', line 31

def bootstrap_options
  @bootstrap_options
end

#machine_image_typeAWSCDK::EKSv2::MachineImageType? (readonly)

Note:

Default: MachineImageType.AMAZON_LINUX_2

Allow options to specify different machine image type.



36
37
38
# File 'ek_sv2/auto_scaling_group_options.rb', line 36

def machine_image_type
  @machine_image_type
end

Class Method Details

.jsii_propertiesObject



38
39
40
41
42
43
44
# File 'ek_sv2/auto_scaling_group_options.rb', line 38

def self.jsii_properties
  {
    :bootstrap_enabled => "bootstrapEnabled",
    :bootstrap_options => "bootstrapOptions",
    :machine_image_type => "machineImageType",
  }
end

Instance Method Details

#to_jsiiObject



46
47
48
49
50
51
52
53
54
# File 'ek_sv2/auto_scaling_group_options.rb', line 46

def to_jsii
  result = {}
  result.merge!({
    "bootstrapEnabled" => @bootstrap_enabled,
    "bootstrapOptions" => @bootstrap_options,
    "machineImageType" => @machine_image_type,
  })
  result.compact
end