AutoScalingGroupOptions

class aws_cdk.aws_eks.AutoScalingGroupOptions(*, bootstrap_enabled=None, bootstrap_options=None, machine_image_type=None, map_role=None, spot_interrupt_handler=None)

Bases: object

Options for adding an AutoScalingGroup as capacity.

Parameters:
  • bootstrap_enabled (Optional[bool]) – 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(). Default: true

  • bootstrap_options (Union[BootstrapOptions, Dict[str, Any], None]) – Allows options for node bootstrapping through EC2 user data. Default: - default options

  • machine_image_type (Optional[MachineImageType]) – Allow options to specify different machine image type. Default: MachineImageType.AMAZON_LINUX_2

  • map_role (Optional[bool]) – 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. Default: - true if the cluster has kubectl enabled (which is the default).

  • spot_interrupt_handler (Optional[bool]) – Installs the AWS spot instance interrupt handler on the cluster if it’s not already added. Only relevant if spotPrice is configured on the auto-scaling group. Default: true

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster
# asg: autoscaling.AutoScalingGroup

cluster.connect_auto_scaling_group_capacity(asg)

Attributes

bootstrap_enabled

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

Default:

true

bootstrap_options

Allows options for node bootstrapping through EC2 user data.

Default:
  • default options

machine_image_type

Allow options to specify different machine image type.

Default:

MachineImageType.AMAZON_LINUX_2

map_role

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.

Default:
  • true if the cluster has kubectl enabled (which is the default).

spot_interrupt_handler

Installs the AWS spot instance interrupt handler on the cluster if it’s not already added.

Only relevant if spotPrice is configured on the auto-scaling group.

Default:

true