# AutoScalingGroupOptions

Options for adding an AutoScalingGroup as capacity.

Used as argument in: [ICluster.connectAutoScalingGroupCapacity](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.ICluster.html#connectautoscalinggroupcapacity)

- Source: [`aws-eks/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-eks/lib/cluster.ts#L2701)

## Example

TypeScript:

```ts
declare const cluster: eks.Cluster;
declare const asg: autoscaling.AutoScalingGroup;
cluster.connectAutoScalingGroupCapacity(asg, {});
```

Python:

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

cluster.connect_auto_scaling_group_capacity(asg)
```

Java:

```java
Cluster cluster;
AutoScalingGroup asg;

cluster.connectAutoScalingGroupCapacity(asg, AutoScalingGroupOptions.builder().build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;
AutoScalingGroup asg;

cluster.ConnectAutoScalingGroupCapacity(asg, new AutoScalingGroupOptions { });
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster
var asg AutoScalingGroup

cluster.connectAutoScalingGroupCapacity(asg, &AutoScalingGroupOptions{
})
```

## Properties

- `bootstrapEnabled`: boolean = 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()`.

- `bootstrapOptions`: [BootstrapOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.BootstrapOptions.html) — Allows options for node bootstrapping through EC2 user data.

  **Default:** default options

- `machineImageType`: [MachineImageType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.MachineImageType.html) = MachineImageType.AMAZON_LINUX_2 — Allow options to specify different machine image type.

- `mapRole`: boolean — Will automatically update the aws-auth ConfigMap to map the IAM instance role to RBAC.

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

  This cannot be explicitly set to `true` if the cluster has kubectl disabled.

- `spotInterruptHandler`: boolean = true — 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.
