UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

1,096 lines • 51.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as enums from "../types/enums"; import { LaunchConfiguration, PlacementGroup } from "../ec2"; /** * Provides an Auto Scaling Group resource. * * > **Note:** You must specify either `launchConfiguration`, `launchTemplate`, or `mixedInstancesPolicy`. * * > **NOTE on Auto Scaling Groups, Attachments and Traffic Source Attachments:** Pulumi provides standalone Attachment (for attaching Classic Load Balancers and Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target groups) and Traffic Source Attachment (for attaching Load Balancers and VPC Lattice target groups) resources and an Auto Scaling Group resource with `loadBalancers`, `targetGroupArns` and `trafficSource` attributes. Do not use the same traffic source in more than one of these resources. Doing so will cause a conflict of attachments. A `lifecycle` configuration block can be used to suppress differences if necessary. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.ec2.PlacementGroup("test", { * name: "test", * strategy: aws.ec2.PlacementStrategy.Cluster, * }); * const bar = new aws.autoscaling.Group("bar", { * name: "foobar3-test", * maxSize: 5, * minSize: 2, * healthCheckGracePeriod: 300, * healthCheckType: "ELB", * desiredCapacity: 4, * forceDelete: true, * placementGroup: test.id, * launchConfiguration: foobar.name, * vpcZoneIdentifiers: [ * example1.id, * example2.id, * ], * instanceMaintenancePolicy: { * minHealthyPercentage: 90, * maxHealthyPercentage: 120, * }, * initialLifecycleHooks: [{ * name: "foobar", * defaultResult: "CONTINUE", * heartbeatTimeout: 2000, * lifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING", * notificationMetadata: JSON.stringify({ * foo: "bar", * }), * notificationTargetArn: "arn:aws:sqs:us-east-1:444455556666:queue1*", * roleArn: "arn:aws:iam::123456789012:role/S3Access", * }], * tags: [ * { * key: "foo", * value: "bar", * propagateAtLaunch: true, * }, * { * key: "lorem", * value: "ipsum", * propagateAtLaunch: false, * }, * ], * }); * ``` * * ### With Latest Version Of Launch Template * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const foobar = new aws.ec2.LaunchTemplate("foobar", { * namePrefix: "foobar", * imageId: "ami-1a2b3c", * instanceType: "t2.micro", * }); * const bar = new aws.autoscaling.Group("bar", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 1, * minSize: 1, * launchTemplate: { * id: foobar.id, * version: "$Latest", * }, * }); * ``` * * ### Mixed Instances Policy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.LaunchTemplate("example", { * namePrefix: "example", * imageId: exampleAwsAmi.id, * instanceType: "c5.large", * }); * const exampleGroup = new aws.autoscaling.Group("example", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 1, * minSize: 1, * mixedInstancesPolicy: { * launchTemplate: { * launchTemplateSpecification: { * launchTemplateId: example.id, * }, * overrides: [ * { * instanceType: "c4.large", * weightedCapacity: "3", * }, * { * instanceType: "c3.large", * weightedCapacity: "2", * }, * ], * }, * }, * }); * ``` * * ### Mixed Instances Policy with Spot Instances and Capacity Rebalance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.LaunchTemplate("example", { * namePrefix: "example", * imageId: exampleAwsAmi.id, * instanceType: "c5.large", * }); * const exampleGroup = new aws.autoscaling.Group("example", { * capacityRebalance: true, * desiredCapacity: 12, * maxSize: 15, * minSize: 12, * vpcZoneIdentifiers: [ * example1.id, * example2.id, * ], * mixedInstancesPolicy: { * instancesDistribution: { * onDemandBaseCapacity: 0, * onDemandPercentageAboveBaseCapacity: 25, * spotAllocationStrategy: "capacity-optimized", * }, * launchTemplate: { * launchTemplateSpecification: { * launchTemplateId: example.id, * }, * overrides: [ * { * instanceType: "c4.large", * weightedCapacity: "3", * }, * { * instanceType: "c3.large", * weightedCapacity: "2", * }, * ], * }, * }, * }); * ``` * * ### Mixed Instances Policy with Instance level LaunchTemplateSpecification Overrides * * When using a diverse instance set, some instance types might require a launch template with configuration values unique to that instance type such as a different AMI (Graviton2), architecture specific user data script, different EBS configuration, or different networking configuration. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.LaunchTemplate("example", { * namePrefix: "example", * imageId: exampleAwsAmi.id, * instanceType: "c5.large", * }); * const example2 = new aws.ec2.LaunchTemplate("example2", { * namePrefix: "example2", * imageId: example2AwsAmi.id, * }); * const exampleGroup = new aws.autoscaling.Group("example", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 1, * minSize: 1, * mixedInstancesPolicy: { * launchTemplate: { * launchTemplateSpecification: { * launchTemplateId: example.id, * }, * overrides: [ * { * instanceType: "c4.large", * weightedCapacity: "3", * }, * { * instanceType: "c6g.large", * launchTemplateSpecification: { * launchTemplateId: example2.id, * }, * weightedCapacity: "2", * }, * ], * }, * }, * }); * ``` * * ### Mixed Instances Policy with Attribute-based Instance Type Selection * * As an alternative to manually choosing instance types when creating a mixed instances group, you can specify a set of instance attributes that describe your compute requirements. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.LaunchTemplate("example", { * namePrefix: "example", * imageId: exampleAwsAmi.id, * instanceType: "c5.large", * }); * const exampleGroup = new aws.autoscaling.Group("example", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 1, * minSize: 1, * mixedInstancesPolicy: { * launchTemplate: { * launchTemplateSpecification: { * launchTemplateId: example.id, * }, * overrides: [{ * instanceRequirements: { * memoryMib: { * min: 1000, * }, * vcpuCount: { * min: 4, * }, * }, * }], * }, * }, * }); * ``` * * ### Dynamic tagging * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const config = new pulumi.Config(); * const extraTags = config.getObject<any>("extraTags") || [ * { * key: "Foo", * propagateAtLaunch: true, * value: "Bar", * }, * { * key: "Baz", * propagateAtLaunch: true, * value: "Bam", * }, * ]; * const test = new aws.autoscaling.Group("test", { * tags: [ * { * key: "explicit1", * value: "value1", * propagateAtLaunch: true, * }, * { * key: "explicit2", * value: "value2", * propagateAtLaunch: true, * }, * ], * name: "foobar3-test", * maxSize: 5, * minSize: 2, * launchConfiguration: foobar.name, * vpcZoneIdentifiers: [ * example1.id, * example2.id, * ], * }); * ``` * * ### Automatically refresh all instances after the group is updated * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.ec2.getAmi({ * mostRecent: true, * owners: ["amazon"], * filters: [{ * name: "name", * values: ["amzn-ami-hvm-*-x86_64-gp2"], * }], * }); * const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("example", { * imageId: example.then(example => example.id), * instanceType: "t3.nano", * }); * const exampleGroup = new aws.autoscaling.Group("example", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 2, * minSize: 1, * launchTemplate: { * id: exampleLaunchTemplate.id, * version: exampleLaunchTemplate.latestVersion, * }, * tags: [{ * key: "Key", * value: "Value", * propagateAtLaunch: true, * }], * instanceRefresh: { * strategy: "Rolling", * preferences: { * minHealthyPercentage: 50, * }, * triggers: ["tag"], * }, * }); * ``` * * ### Auto Scaling group with Warm Pool * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.LaunchTemplate("example", { * namePrefix: "example", * imageId: exampleAwsAmi.id, * instanceType: "c5.large", * }); * const exampleGroup = new aws.autoscaling.Group("example", { * availabilityZones: ["us-east-1a"], * desiredCapacity: 1, * maxSize: 5, * minSize: 1, * warmPool: { * poolState: "Hibernated", * minSize: 1, * maxGroupPreparedCapacity: 10, * instanceReusePolicy: { * reuseOnScaleIn: true, * }, * }, * }); * ``` * * ### Auto Scaling group with Traffic Sources * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.autoscaling.Group("test", { * trafficSources: testAwsVpclatticeTargetGroup.map(__item => __item).map((v, k) => ({key: k, value: v})).map(entry => ({ * identifier: entry.value.arn, * type: "vpc-lattice", * })), * vpcZoneIdentifiers: testAwsSubnet.id, * maxSize: 1, * minSize: 1, * forceDelete: true, * }); * ``` * * ## Waiting for Capacity * * A newly-created ASG is initially empty and begins to scale to `minSize` (or * `desiredCapacity`, if specified) by launching instances using the provided * Launch Configuration. These instances take time to launch and boot. * * On ASG Update, changes to these values also take time to result in the target * number of instances providing service. * * This provider provides two mechanisms to help consistently manage ASG scale up * time across dependent resources. * * #### Waiting for ASG Capacity * * The first is default behavior. This provider waits after ASG creation for * `minSize` (or `desiredCapacity`, if specified) healthy instances to show up * in the ASG before continuing. * * If `minSize` or `desiredCapacity` are changed in a subsequent update, * this provider will also wait for the correct number of healthy instances before * continuing. * * This provider considers an instance "healthy" when the ASG reports `HealthStatus: * "Healthy"` and `LifecycleState: "InService"`. See the [AWS AutoScaling * Docs](https://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingGroupLifecycle.html) * for more information on an ASG's lifecycle. * * This provider will wait for healthy instances for up to * `waitForCapacityTimeout`. If ASG creation is taking more than a few minutes, * it's worth investigating for scaling activity errors, which can be caused by * problems with the selected Launch Configuration. * * Setting `waitForCapacityTimeout` to `"0"` disables ASG Capacity waiting. * * #### Waiting for ELB Capacity * * The second mechanism is optional, and affects ASGs with attached ELBs specified * via the `loadBalancers` attribute or with ALBs specified with `targetGroupArns`. * * The `minElbCapacity` parameter causes the provider to wait for at least the * requested number of instances to show up `"InService"` in all attached ELBs * during ASG creation. It has no effect on ASG updates. * * If `waitForElbCapacity` is set, the provider will wait for exactly that number * of Instances to be `"InService"` in all attached ELBs on both creation and * updates. * * These parameters can be used to ensure that service is being provided before * the provider moves on. If new instances don't pass the ELB's health checks for any * reason, the apply will time out, and the ASG will be marked as * tainted (i.e., marked to be destroyed in a follow up run). * * As with ASG Capacity, the provider will wait for up to `waitForCapacityTimeout` * for the proper number of instances to be healthy. * * #### Troubleshooting Capacity Waiting Timeouts * * If ASG creation takes more than a few minutes, this could indicate one of a * number of configuration problems. See the [AWS Docs on Load Balancer * Troubleshooting](https://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-troubleshooting.html) * for more information. * * ## Import * * Using `pulumi import`, import Auto Scaling Groups using the `name`. For example: * * ```sh * $ pulumi import aws:autoscaling/group:Group web web-asg * ``` */ export declare class Group extends pulumi.CustomResource { /** * Get an existing Group resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GroupState, opts?: pulumi.CustomResourceOptions): Group; /** * Returns true if the given object is an instance of Group. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Group; /** * ARN for this Auto Scaling Group */ readonly arn: pulumi.Output<string>; /** * The instance capacity distribution across Availability Zones. See Availability Zone Distribution below for more details. */ readonly availabilityZoneDistribution: pulumi.Output<outputs.autoscaling.GroupAvailabilityZoneDistribution>; /** * A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the `vpcZoneIdentifier` attribute, or for attaching a network interface when an existing network interface ID is specified in a launch template. Conflicts with `vpcZoneIdentifier`. */ readonly availabilityZones: pulumi.Output<string[]>; /** * Whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. */ readonly capacityRebalance: pulumi.Output<boolean | undefined>; /** * The capacity reservation specification for the Auto Scaling group allows you to prioritize launching into On-Demand Capacity Reservations. See Capacity Reservation Specification below for more details. */ readonly capacityReservationSpecification: pulumi.Output<outputs.autoscaling.GroupCapacityReservationSpecification>; /** * Reserved. */ readonly context: pulumi.Output<string | undefined>; /** * Amount of time, in seconds, after a scaling activity completes before another scaling activity can start. */ readonly defaultCooldown: pulumi.Output<number>; /** * 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. (See [Set the default instance warmup for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html)) */ readonly defaultInstanceWarmup: pulumi.Output<number | undefined>; /** * Number of Amazon EC2 instances that * should be running in the group. (See also Waiting for * Capacity below.) */ readonly desiredCapacity: pulumi.Output<number>; /** * The unit of measurement for the value specified for `desiredCapacity`. Supported for attribute-based instance type selection only. Valid values: `"units"`, `"vcpu"`, `"memory-mib"`. */ readonly desiredCapacityType: pulumi.Output<string | undefined>; /** * List of metrics to collect. The allowed values are defined by the [underlying AWS API](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html). */ readonly enabledMetrics: pulumi.Output<enums.autoscaling.Metric[] | undefined>; /** * Allows deleting the Auto Scaling Group without waiting * for all instances in the pool to terminate. You can force an Auto Scaling Group to delete * even if it's in the process of scaling a resource. Normally, this provider * drains all the instances before deleting the group. This bypasses that * behavior and potentially leaves resources dangling. */ readonly forceDelete: pulumi.Output<boolean | undefined>; /** * Allows deleting the Auto Scaling Group without waiting for all instances in the warm pool to terminate. */ readonly forceDeleteWarmPool: pulumi.Output<boolean | undefined>; /** * Time (in seconds) after instance comes into service before checking health. */ readonly healthCheckGracePeriod: pulumi.Output<number | undefined>; /** * "EC2" or "ELB". Controls how health checking is done. */ readonly healthCheckType: pulumi.Output<string>; /** * Whether to ignore failed [Auto Scaling scaling activities](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html) while waiting for capacity. The default is `false` -- failed scaling activities cause errors to be returned. */ readonly ignoreFailedScalingActivities: pulumi.Output<boolean | undefined>; /** * One or more * [Lifecycle Hooks](http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html) * to attach to the Auto Scaling Group **before** instances are launched. The * syntax is exactly the same as the separate * `aws.autoscaling.LifecycleHook` * resource, without the `autoscalingGroupName` attribute. Please note that this will only work when creating * a new Auto Scaling Group. For all other use-cases, please use `aws.autoscaling.LifecycleHook` resource. */ readonly initialLifecycleHooks: pulumi.Output<outputs.autoscaling.GroupInitialLifecycleHook[] | undefined>; /** * If this block is configured, add a instance maintenance policy to the specified Auto Scaling group. Defined below. */ readonly instanceMaintenancePolicy: pulumi.Output<outputs.autoscaling.GroupInstanceMaintenancePolicy | undefined>; /** * If this block is configured, start an * [Instance Refresh](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) * when this Auto Scaling Group is updated. Defined below. */ readonly instanceRefresh: pulumi.Output<outputs.autoscaling.GroupInstanceRefresh | undefined>; /** * Name of the launch configuration to use. */ readonly launchConfiguration: pulumi.Output<string | undefined>; /** * Nested argument with Launch template specification to use to launch instances. See Launch Template below for more details. */ readonly launchTemplate: pulumi.Output<outputs.autoscaling.GroupLaunchTemplate>; /** * List of elastic load balancer names to add to the autoscaling * group names. Only valid for classic load balancers. For ALBs, use `targetGroupArns` instead. To remove all load balancer attachments an empty list should be specified. */ readonly loadBalancers: pulumi.Output<string[]>; /** * Maximum amount of time, in seconds, that an instance can be in service, values must be either equal to 0 or between 86400 and 31536000 seconds. */ readonly maxInstanceLifetime: pulumi.Output<number | undefined>; /** * Maximum size of the Auto Scaling Group. */ readonly maxSize: pulumi.Output<number>; /** * Granularity to associate with the metrics to collect. The only valid value is `1Minute`. Default is `1Minute`. */ readonly metricsGranularity: pulumi.Output<string | undefined>; /** * Setting this causes Pulumi to wait for * this number of instances from this Auto Scaling Group to show up healthy in the * ELB only on creation. Updates will not wait on ELB instance number changes. * (See also Waiting for Capacity below.) */ readonly minElbCapacity: pulumi.Output<number | undefined>; /** * Minimum size of the Auto Scaling Group. * (See also Waiting for Capacity below.) */ readonly minSize: pulumi.Output<number>; /** * Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details. */ readonly mixedInstancesPolicy: pulumi.Output<outputs.autoscaling.GroupMixedInstancesPolicy>; /** * Name of the Auto Scaling Group. By default generated by Pulumi. Conflicts with `namePrefix`. */ readonly name: pulumi.Output<string>; /** * Creates a unique name beginning with the specified * prefix. Conflicts with `name`. */ readonly namePrefix: pulumi.Output<string>; /** * Name of the placement group into which you'll launch your instances, if any. */ readonly placementGroup: pulumi.Output<string | undefined>; /** * Predicted capacity of the group. */ readonly predictedCapacity: pulumi.Output<number>; /** * Whether newly launched instances * are automatically protected from termination by Amazon EC2 Auto Scaling when * scaling in. For more information about preventing instances from terminating * on scale in, see [Using instance scale-in protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) * in the Amazon EC2 Auto Scaling User Guide. */ readonly protectFromScaleIn: pulumi.Output<boolean | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * ARN of the service-linked role that the ASG will use to call other AWS services */ readonly serviceLinkedRoleArn: pulumi.Output<string>; /** * List of processes to suspend for the Auto Scaling Group. The allowed values are `Launch`, `Terminate`, `HealthCheck`, `ReplaceUnhealthy`, `AZRebalance`, `AlarmNotification`, `ScheduledActions`, `AddToLoadBalancer`, `InstanceRefresh`. * Note that if you suspend either the `Launch` or `Terminate` process types, it can prevent your Auto Scaling Group from functioning properly. */ readonly suspendedProcesses: pulumi.Output<string[] | undefined>; /** * Configuration block(s) containing resource tags. See Tag below for more details. */ readonly tags: pulumi.Output<outputs.autoscaling.GroupTag[] | undefined>; /** * Set of `aws.alb.TargetGroup` ARNs, for use with Application or Network Load Balancing. To remove all target group attachments an empty list should be specified. */ readonly targetGroupArns: pulumi.Output<string[]>; /** * List of policies to decide how the instances in the Auto Scaling Group should be terminated. The allowed values are `OldestInstance`, `NewestInstance`, `OldestLaunchConfiguration`, `ClosestToNextInstanceHour`, `OldestLaunchTemplate`, `AllocationStrategy`, `Default`. Additionally, the ARN of a Lambda function can be specified for custom termination policies. */ readonly terminationPolicies: pulumi.Output<string[] | undefined>; /** * Attaches one or more traffic sources to the specified Auto Scaling group. */ readonly trafficSources: pulumi.Output<outputs.autoscaling.GroupTrafficSource[]>; /** * List of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availabilityZones`. */ readonly vpcZoneIdentifiers: pulumi.Output<string[]>; /** * Maximum * [duration](https://golang.org/pkg/time/#ParseDuration) that the provider should * wait for ASG instances to be healthy before timing out. (See also Waiting * for Capacity below.) Setting this to "0" causes * the provider to skip all Capacity Waiting behavior. */ readonly waitForCapacityTimeout: pulumi.Output<string | undefined>; /** * Setting this will cause Pulumi to wait * for exactly this number of healthy instances from this Auto Scaling Group in * all attached load balancers on both create and update operations. (Takes * precedence over `minElbCapacity` behavior.) * (See also Waiting for Capacity below.) */ readonly waitForElbCapacity: pulumi.Output<number | undefined>; /** * If this block is configured, add a [Warm Pool](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) * to the specified Auto Scaling group. Defined below */ readonly warmPool: pulumi.Output<outputs.autoscaling.GroupWarmPool | undefined>; /** * Current size of the warm pool. */ readonly warmPoolSize: pulumi.Output<number>; /** * Create a Group resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: GroupArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Group resources. */ export interface GroupState { /** * ARN for this Auto Scaling Group */ arn?: pulumi.Input<string>; /** * The instance capacity distribution across Availability Zones. See Availability Zone Distribution below for more details. */ availabilityZoneDistribution?: pulumi.Input<inputs.autoscaling.GroupAvailabilityZoneDistribution>; /** * A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the `vpcZoneIdentifier` attribute, or for attaching a network interface when an existing network interface ID is specified in a launch template. Conflicts with `vpcZoneIdentifier`. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * Whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. */ capacityRebalance?: pulumi.Input<boolean>; /** * The capacity reservation specification for the Auto Scaling group allows you to prioritize launching into On-Demand Capacity Reservations. See Capacity Reservation Specification below for more details. */ capacityReservationSpecification?: pulumi.Input<inputs.autoscaling.GroupCapacityReservationSpecification>; /** * Reserved. */ context?: pulumi.Input<string>; /** * Amount of time, in seconds, after a scaling activity completes before another scaling activity can start. */ defaultCooldown?: pulumi.Input<number>; /** * 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. (See [Set the default instance warmup for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html)) */ defaultInstanceWarmup?: pulumi.Input<number>; /** * Number of Amazon EC2 instances that * should be running in the group. (See also Waiting for * Capacity below.) */ desiredCapacity?: pulumi.Input<number>; /** * The unit of measurement for the value specified for `desiredCapacity`. Supported for attribute-based instance type selection only. Valid values: `"units"`, `"vcpu"`, `"memory-mib"`. */ desiredCapacityType?: pulumi.Input<string>; /** * List of metrics to collect. The allowed values are defined by the [underlying AWS API](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html). */ enabledMetrics?: pulumi.Input<pulumi.Input<enums.autoscaling.Metric>[]>; /** * Allows deleting the Auto Scaling Group without waiting * for all instances in the pool to terminate. You can force an Auto Scaling Group to delete * even if it's in the process of scaling a resource. Normally, this provider * drains all the instances before deleting the group. This bypasses that * behavior and potentially leaves resources dangling. */ forceDelete?: pulumi.Input<boolean>; /** * Allows deleting the Auto Scaling Group without waiting for all instances in the warm pool to terminate. */ forceDeleteWarmPool?: pulumi.Input<boolean>; /** * Time (in seconds) after instance comes into service before checking health. */ healthCheckGracePeriod?: pulumi.Input<number>; /** * "EC2" or "ELB". Controls how health checking is done. */ healthCheckType?: pulumi.Input<string>; /** * Whether to ignore failed [Auto Scaling scaling activities](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html) while waiting for capacity. The default is `false` -- failed scaling activities cause errors to be returned. */ ignoreFailedScalingActivities?: pulumi.Input<boolean>; /** * One or more * [Lifecycle Hooks](http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html) * to attach to the Auto Scaling Group **before** instances are launched. The * syntax is exactly the same as the separate * `aws.autoscaling.LifecycleHook` * resource, without the `autoscalingGroupName` attribute. Please note that this will only work when creating * a new Auto Scaling Group. For all other use-cases, please use `aws.autoscaling.LifecycleHook` resource. */ initialLifecycleHooks?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupInitialLifecycleHook>[]>; /** * If this block is configured, add a instance maintenance policy to the specified Auto Scaling group. Defined below. */ instanceMaintenancePolicy?: pulumi.Input<inputs.autoscaling.GroupInstanceMaintenancePolicy>; /** * If this block is configured, start an * [Instance Refresh](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) * when this Auto Scaling Group is updated. Defined below. */ instanceRefresh?: pulumi.Input<inputs.autoscaling.GroupInstanceRefresh>; /** * Name of the launch configuration to use. */ launchConfiguration?: pulumi.Input<string | LaunchConfiguration>; /** * Nested argument with Launch template specification to use to launch instances. See Launch Template below for more details. */ launchTemplate?: pulumi.Input<inputs.autoscaling.GroupLaunchTemplate>; /** * List of elastic load balancer names to add to the autoscaling * group names. Only valid for classic load balancers. For ALBs, use `targetGroupArns` instead. To remove all load balancer attachments an empty list should be specified. */ loadBalancers?: pulumi.Input<pulumi.Input<string>[]>; /** * Maximum amount of time, in seconds, that an instance can be in service, values must be either equal to 0 or between 86400 and 31536000 seconds. */ maxInstanceLifetime?: pulumi.Input<number>; /** * Maximum size of the Auto Scaling Group. */ maxSize?: pulumi.Input<number>; /** * Granularity to associate with the metrics to collect. The only valid value is `1Minute`. Default is `1Minute`. */ metricsGranularity?: pulumi.Input<string | enums.autoscaling.MetricsGranularity>; /** * Setting this causes Pulumi to wait for * this number of instances from this Auto Scaling Group to show up healthy in the * ELB only on creation. Updates will not wait on ELB instance number changes. * (See also Waiting for Capacity below.) */ minElbCapacity?: pulumi.Input<number>; /** * Minimum size of the Auto Scaling Group. * (See also Waiting for Capacity below.) */ minSize?: pulumi.Input<number>; /** * Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details. */ mixedInstancesPolicy?: pulumi.Input<inputs.autoscaling.GroupMixedInstancesPolicy>; /** * Name of the Auto Scaling Group. By default generated by Pulumi. Conflicts with `namePrefix`. */ name?: pulumi.Input<string>; /** * Creates a unique name beginning with the specified * prefix. Conflicts with `name`. */ namePrefix?: pulumi.Input<string>; /** * Name of the placement group into which you'll launch your instances, if any. */ placementGroup?: pulumi.Input<string | PlacementGroup>; /** * Predicted capacity of the group. */ predictedCapacity?: pulumi.Input<number>; /** * Whether newly launched instances * are automatically protected from termination by Amazon EC2 Auto Scaling when * scaling in. For more information about preventing instances from terminating * on scale in, see [Using instance scale-in protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) * in the Amazon EC2 Auto Scaling User Guide. */ protectFromScaleIn?: pulumi.Input<boolean>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * ARN of the service-linked role that the ASG will use to call other AWS services */ serviceLinkedRoleArn?: pulumi.Input<string>; /** * List of processes to suspend for the Auto Scaling Group. The allowed values are `Launch`, `Terminate`, `HealthCheck`, `ReplaceUnhealthy`, `AZRebalance`, `AlarmNotification`, `ScheduledActions`, `AddToLoadBalancer`, `InstanceRefresh`. * Note that if you suspend either the `Launch` or `Terminate` process types, it can prevent your Auto Scaling Group from functioning properly. */ suspendedProcesses?: pulumi.Input<pulumi.Input<string>[]>; /** * Configuration block(s) containing resource tags. See Tag below for more details. */ tags?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupTag>[]>; /** * Set of `aws.alb.TargetGroup` ARNs, for use with Application or Network Load Balancing. To remove all target group attachments an empty list should be specified. */ targetGroupArns?: pulumi.Input<pulumi.Input<string>[]>; /** * List of policies to decide how the instances in the Auto Scaling Group should be terminated. The allowed values are `OldestInstance`, `NewestInstance`, `OldestLaunchConfiguration`, `ClosestToNextInstanceHour`, `OldestLaunchTemplate`, `AllocationStrategy`, `Default`. Additionally, the ARN of a Lambda function can be specified for custom termination policies. */ terminationPolicies?: pulumi.Input<pulumi.Input<string>[]>; /** * Attaches one or more traffic sources to the specified Auto Scaling group. */ trafficSources?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupTrafficSource>[]>; /** * List of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availabilityZones`. */ vpcZoneIdentifiers?: pulumi.Input<pulumi.Input<string>[]>; /** * Maximum * [duration](https://golang.org/pkg/time/#ParseDuration) that the provider should * wait for ASG instances to be healthy before timing out. (See also Waiting * for Capacity below.) Setting this to "0" causes * the provider to skip all Capacity Waiting behavior. */ waitForCapacityTimeout?: pulumi.Input<string>; /** * Setting this will cause Pulumi to wait * for exactly this number of healthy instances from this Auto Scaling Group in * all attached load balancers on both create and update operations. (Takes * precedence over `minElbCapacity` behavior.) * (See also Waiting for Capacity below.) */ waitForElbCapacity?: pulumi.Input<number>; /** * If this block is configured, add a [Warm Pool](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) * to the specified Auto Scaling group. Defined below */ warmPool?: pulumi.Input<inputs.autoscaling.GroupWarmPool>; /** * Current size of the warm pool. */ warmPoolSize?: pulumi.Input<number>; } /** * The set of arguments for constructing a Group resource. */ export interface GroupArgs { /** * The instance capacity distribution across Availability Zones. See Availability Zone Distribution below for more details. */ availabilityZoneDistribution?: pulumi.Input<inputs.autoscaling.GroupAvailabilityZoneDistribution>; /** * A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the `vpcZoneIdentifier` attribute, or for attaching a network interface when an existing network interface ID is specified in a launch template. Conflicts with `vpcZoneIdentifier`. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * Whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. */ capacityRebalance?: pulumi.Input<boolean>; /** * The capacity reservation specification for the Auto Scaling group allows you to prioritize launching into On-Demand Capacity Reservations. See Capacity Reservation Specification below for more details. */ capacityReservationSpecification?: pulumi.Input<inputs.autoscaling.GroupCapacityReservationSpecification>; /** * Reserved. */ context?: pulumi.Input<string>; /** * Amount of time, in seconds, after a scaling activity completes before another scaling activity can start. */ defaultCooldown?: pulumi.Input<number>; /** * 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. (See [Set the default instance warmup for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html)) */ defaultInstanceWarmup?: pulumi.Input<number>; /** * Number of Amazon EC2 instances that * should be running in the group. (See also Waiting for * Capacity below.) */ desiredCapacity?: pulumi.Input<number>; /** * The unit of measurement for the value specified for `desiredCapacity`. Supported for attribute-based instance type selection only. Valid values: `"units"`, `"vcpu"`, `"memory-mib"`. */ desiredCapacityType?: pulumi.Input<string>; /** * List of metrics to collect. The allowed values are defined by the [underlying AWS API](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html). */ enabledMetrics?: pulumi.Input<pulumi.Input<enums.autoscaling.Metric>[]>; /** * Allows deleting the Auto Scaling Group without waiting * for all instances in the pool to terminate. You can force an Auto Scaling Group to delete * even if it's in the process of scaling a resource. Normally, this provider * drains all the instances before deleting the group. This bypasses that * behavior and potentially leaves resources dangling. */ forceDelete?: pulumi.Input<boolean>; /** * Allows deleting the Auto Scaling Group without waiting for all instances in the warm pool to terminate. */ forceDeleteWarmPool?: pulumi.Input<boolean>; /** * Time (in seconds) after instance comes into service before checking health. */ healthCheckGracePeriod?: pulumi.Input<number>; /** * "EC2" or "ELB". Controls how health checking is done. */ healthCheckType?: pulumi.Input<string>; /** * Whether to ignore failed [Auto Scaling scaling activities](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html) while waiting for capacity. The default is `false` -- failed scaling activities cause errors to be returned. */ ignoreFailedScalingActivities?: pulumi.Input<boolean>; /** * One or more * [Lifecycle Hooks](http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html) * to attach to the Auto Scaling Group **before** instances are launched. The * syntax is exactly the same as the separate * `aws.autoscaling.LifecycleHook` * resource, without the `autoscalingGroupName` attribute. Please note that this will only work when creating * a new Auto Scaling Group. For all other use-cases, please use `aws.autoscaling.LifecycleHook` resource. */ initialLifecycleHooks?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupInitialLifecycleHook>[]>; /** * If this block is configured, add a instance maintenance policy to the specified Auto Scaling group. Defined below. */ instanceMaintenancePolicy?: pulumi.Input<inputs.autoscaling.GroupInstanceMaintenancePolicy>; /** * If this block is configured, start an * [Instance Refresh](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) * when this Auto Scaling Group is updated. Defined below. */ instanceRefresh?: pulumi.Input<inputs.autoscaling.GroupInstanceRefresh>; /** * Name of the launch configuration to use. */ launchConfiguration?: pulumi.Input<string | LaunchConfiguration>; /** * Nested argument with Launch template specification to use to launch instances. See Launch Template below for more details. */ launchTemplate?: pulumi.Input<inputs.autoscaling.GroupLaunchTemplate>; /** * List of elastic load balancer names to add to the autoscaling * group names. Only valid for classic load balancers. For ALBs, use `targetGroupArns` instead. To remove all load balancer attachments an empty list should be specified. */ loadBalancers?: pulumi.Input<pulumi.Input<string>[]>; /** * Maximum amount of time, in seconds, that an instance can be in service, values must be either equal to 0 or between 86400 and 31536000 seconds. */ maxInstanceLifetime?: pulumi.Input<number>; /** * Maximum size of the Auto Scaling Group. */ maxSize: pulumi.Input<number>; /** * Granularity to associate with the metrics to collect. The only valid value is `1Minute`. Default is `1Minute`. */ metricsGranularity?: pulumi.Input<string | enums.autoscaling.MetricsGranularity>; /** * Setting this causes Pulumi to wait for * this number of instances from this Auto Scaling Group to show up healthy in the * ELB only on creation. Updates will not wait on ELB instance number changes. * (See also Waiting for Capacity below.) */ minElbCapacity?: pulumi.Input<number>; /** * Minimum size of the Auto Scaling Group. * (See also Waiting for Capacity below.) */ minSize: pulumi.Input<number>; /** * Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details. */ mixedInstancesPolicy?: pulumi.Input<inputs.autoscaling.GroupMixedInstancesPolicy>; /** * Name of the Auto Scaling Group. By default generated by Pulumi. Conflicts with `namePrefix`. */ name?: pulumi.Input<string>; /** * Creates a unique name beginning with the specified * prefix. Conflicts with `name`. */ namePrefix?: pulumi.Input<string>; /** * Name of the placement group into which you'll launch your instances, if any. */ placementGroup?: pulumi.Input<string | PlacementGroup>; /** * Whether newly launched instances * are automatically protected from termination by Amazon EC2 Auto Scaling when * scaling in. For more information about preventing instances from terminating * on scale in, see [Using instance scale-in protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) * in the Amazon EC2 Auto Scaling User Guide. */ protectFromScaleIn?: pulumi.Input<boolean>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * ARN of the service-linked role that the ASG will use to call other AWS services */ serviceLinkedRoleArn?: pulumi.Input<string>; /** * List of processes to suspend for the Auto Scaling Group. The allowed values are `Launch`, `Terminate`, `HealthCheck`, `ReplaceUnhealthy`, `AZRebalance`, `AlarmNotification`, `ScheduledActions`, `AddToLoadBalancer`, `InstanceRefresh`. * Note that if you suspend either the `Launch` or `Terminate` process types, it can prevent your Auto Scaling Group from functioning properly. */ suspendedProcesses?: pulumi.Input<pulumi.Input<string>[]>; /** * Configuration block(s) containing resource tags. See Tag below for more details. */ tags?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupTag>[]>; /** * Set of `aws.alb.TargetGroup` ARNs, for use with Application or Network Load Balancing. To remove all target group attachments an empty list should be specified. */ targetGroupArns?: pulumi.Input<pulumi.Input<string>[]>; /** * List of policies to decide how the instances in the Auto Scaling Group should be terminated. The allowed values are `OldestInstance`, `NewestInstance`, `OldestLaunchConfiguration`, `ClosestToNextInstanceHour`, `OldestLaunchTemplate`, `AllocationStrategy`, `Default`. Additionally, the ARN of a Lambda function can be specified for custom termination policies. */ terminationPolicies?: pulumi.Input<pulumi.Input<string>[]>; /** * Attaches one or more traffic sources to the specified Auto Scaling group. */ trafficSources?: pulumi.Input<pulumi.Input<inputs.autoscaling.GroupTrafficSource>[]>; /** * List of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availabilityZones`. */ vpcZoneIdenti