Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

Group

Provides an Auto Scaling Group resource.

Note: You must specify either launch_configuration, launch_template, or mixed_instances_policy.

NOTE on Auto Scaling Groups and ASG Attachments: This provider currently provides both a standalone aws.autoscaling.Attachment resource (describing an ASG attached to an ELB or ALB), and an aws.autoscaling.Group with load_balancers and target_group_arns defined in-line. These two methods are not mutually-exclusive. If aws.autoscaling.Attachment resources are used, either alone or with inline load_balancers or target_group_arns, the aws.autoscaling.Group resource must be configured to ignore changes to the load_balancers and target_group_arns arguments.

Waiting for Capacity

A newly-created ASG is initially empty and begins to scale to min_size (or desired_capacity, 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 min_size (or desired_capacity, if specified) healthy instances to show up in the ASG before continuing.

If min_size or desired_capacity 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 for more information on an ASG’s lifecycle.

This provider will wait for healthy instances for up to wait_for_capacity_timeout. 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 wait_for_capacity_timeout to "0" disables ASG Capacity waiting.

Waiting for ELB Capacity

The second mechanism is optional, and affects ASGs with attached ELBs specified via the load_balancers attribute or with ALBs specified with target_group_arns.

The min_elb_capacity parameter causes this 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 wait_for_elb_capacity is set, this 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 this provider moves on. If new instances don’t pass the ELB’s health checks for any reason, the deployment 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, this provider will wait for up to wait_for_capacity_timeout 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 for more information.

Example Usage

With Latest Version Of Launch Template

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var foobar = new Aws.Ec2.LaunchTemplate("foobar", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "foobar",
            ImageId = "ami-1a2b3c",
            InstanceType = "t2.micro",
        });
        var bar = new Aws.AutoScaling.Group("bar", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-east-1a",
            },
            DesiredCapacity = 1,
            MaxSize = 1,
            MinSize = 1,
            LaunchTemplate = new Aws.AutoScaling.Inputs.GroupLaunchTemplateArgs
            {
                Id = foobar.Id,
                Version = "$Latest",
            },
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foobar, err := ec2.NewLaunchTemplate(ctx, "foobar", &ec2.LaunchTemplateArgs{
			NamePrefix:   pulumi.String("foobar"),
			ImageId:      pulumi.String("ami-1a2b3c"),
			InstanceType: pulumi.String("t2.micro"),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "bar", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			DesiredCapacity: pulumi.Int(1),
			MaxSize:         pulumi.Int(1),
			MinSize:         pulumi.Int(1),
			LaunchTemplate: &autoscaling.GroupLaunchTemplateArgs{
				Id:      foobar.ID(),
				Version: pulumi.String(fmt.Sprintf("%v%v", "$", "Latest")),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

foobar = aws.ec2.LaunchTemplate("foobar",
    name_prefix="foobar",
    image_id="ami-1a2b3c",
    instance_type="t2.micro")
bar = aws.autoscaling.Group("bar",
    availability_zones=["us-east-1a"],
    desired_capacity=1,
    max_size=1,
    min_size=1,
    launch_template=aws.autoscaling.GroupLaunchTemplateArgs(
        id=foobar.id,
        version="$Latest",
    ))
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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleLaunchTemplate = new Aws.Ec2.LaunchTemplate("exampleLaunchTemplate", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "example",
            ImageId = data.Aws_ami.Example.Id,
            InstanceType = "c5.large",
        });
        var exampleGroup = new Aws.AutoScaling.Group("exampleGroup", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-east-1a",
            },
            DesiredCapacity = 1,
            MaxSize = 1,
            MinSize = 1,
            MixedInstancesPolicy = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyArgs
            {
                LaunchTemplate = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateArgs
                {
                    LaunchTemplateSpecification = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs
                    {
                        LaunchTemplateId = exampleLaunchTemplate.Id,
                    },
                    Overrides = 
                    {
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c4.large",
                            WeightedCapacity = "3",
                        },
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c3.large",
                            WeightedCapacity = "2",
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleLaunchTemplate, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
			NamePrefix:   pulumi.String("example"),
			ImageId:      pulumi.Any(data.Aws_ami.Example.Id),
			InstanceType: pulumi.String("c5.large"),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "exampleGroup", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			DesiredCapacity: pulumi.Int(1),
			MaxSize:         pulumi.Int(1),
			MinSize:         pulumi.Int(1),
			MixedInstancesPolicy: &autoscaling.GroupMixedInstancesPolicyArgs{
				LaunchTemplate: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs{
					LaunchTemplateSpecification: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs{
						LaunchTemplateId: exampleLaunchTemplate.ID(),
					},
					Overrides: autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArray{
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType:     pulumi.String("c4.large"),
							WeightedCapacity: pulumi.String("3"),
						},
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType:     pulumi.String("c3.large"),
							WeightedCapacity: pulumi.String("2"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_launch_template = aws.ec2.LaunchTemplate("exampleLaunchTemplate",
    name_prefix="example",
    image_id=data["aws_ami"]["example"]["id"],
    instance_type="c5.large")
example_group = aws.autoscaling.Group("exampleGroup",
    availability_zones=["us-east-1a"],
    desired_capacity=1,
    max_size=1,
    min_size=1,
    mixed_instances_policy=aws.autoscaling.GroupMixedInstancesPolicyArgs(
        launch_template=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs(
            launch_template_specification=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs(
                launch_template_id=example_launch_template.id,
            ),
            overrides=[
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c4.large",
                    weighted_capacity="3",
                ),
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c3.large",
                    weighted_capacity="2",
                ),
            ],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("exampleLaunchTemplate", {
    namePrefix: "example",
    imageId: data.aws_ami.example.id,
    instanceType: "c5.large",
});
const exampleGroup = new aws.autoscaling.Group("exampleGroup", {
    availabilityZones: ["us-east-1a"],
    desiredCapacity: 1,
    maxSize: 1,
    minSize: 1,
    mixedInstancesPolicy: {
        launchTemplate: {
            launchTemplateSpecification: {
                launchTemplateId: exampleLaunchTemplate.id,
            },
            overrides: [
                {
                    instanceType: "c4.large",
                    weightedCapacity: "3",
                },
                {
                    instanceType: "c3.large",
                    weightedCapacity: "2",
                },
            ],
        },
    },
});

Mixed Instances Policy with Spot Instances and Capacity Rebalance

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleLaunchTemplate = new Aws.Ec2.LaunchTemplate("exampleLaunchTemplate", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "example",
            ImageId = data.Aws_ami.Example.Id,
            InstanceType = "c5.large",
        });
        var exampleGroup = new Aws.AutoScaling.Group("exampleGroup", new Aws.AutoScaling.GroupArgs
        {
            CapacityRebalance = true,
            DesiredCapacity = 12,
            MaxSize = 15,
            MinSize = 12,
            VpcZoneIdentifiers = 
            {
                aws_subnet.Example1.Id,
                aws_subnet.Example2.Id,
            },
            MixedInstancesPolicy = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyArgs
            {
                InstancesDistribution = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyInstancesDistributionArgs
                {
                    OnDemandBaseCapacity = 0,
                    OnDemandPercentageAboveBaseCapacity = 25,
                    SpotAllocationStrategy = "capacity-optimized",
                },
                LaunchTemplate = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateArgs
                {
                    LaunchTemplateSpecification = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs
                    {
                        LaunchTemplateId = exampleLaunchTemplate.Id,
                    },
                    Overrides = 
                    {
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c4.large",
                            WeightedCapacity = "3",
                        },
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c3.large",
                            WeightedCapacity = "2",
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleLaunchTemplate, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
			NamePrefix:   pulumi.String("example"),
			ImageId:      pulumi.Any(data.Aws_ami.Example.Id),
			InstanceType: pulumi.String("c5.large"),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "exampleGroup", &autoscaling.GroupArgs{
			CapacityRebalance: pulumi.Bool(true),
			DesiredCapacity:   pulumi.Int(12),
			MaxSize:           pulumi.Int(15),
			MinSize:           pulumi.Int(12),
			VpcZoneIdentifiers: pulumi.StringArray{
				pulumi.Any(aws_subnet.Example1.Id),
				pulumi.Any(aws_subnet.Example2.Id),
			},
			MixedInstancesPolicy: &autoscaling.GroupMixedInstancesPolicyArgs{
				InstancesDistribution: &autoscaling.GroupMixedInstancesPolicyInstancesDistributionArgs{
					OnDemandBaseCapacity:                pulumi.Int(0),
					OnDemandPercentageAboveBaseCapacity: pulumi.Int(25),
					SpotAllocationStrategy:              pulumi.String("capacity-optimized"),
				},
				LaunchTemplate: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs{
					LaunchTemplateSpecification: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs{
						LaunchTemplateId: exampleLaunchTemplate.ID(),
					},
					Overrides: autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArray{
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType:     pulumi.String("c4.large"),
							WeightedCapacity: pulumi.String("3"),
						},
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType:     pulumi.String("c3.large"),
							WeightedCapacity: pulumi.String("2"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_launch_template = aws.ec2.LaunchTemplate("exampleLaunchTemplate",
    name_prefix="example",
    image_id=data["aws_ami"]["example"]["id"],
    instance_type="c5.large")
example_group = aws.autoscaling.Group("exampleGroup",
    capacity_rebalance=True,
    desired_capacity=12,
    max_size=15,
    min_size=12,
    vpc_zone_identifiers=[
        aws_subnet["example1"]["id"],
        aws_subnet["example2"]["id"],
    ],
    mixed_instances_policy=aws.autoscaling.GroupMixedInstancesPolicyArgs(
        instances_distribution=aws.autoscaling.GroupMixedInstancesPolicyInstancesDistributionArgs(
            on_demand_base_capacity=0,
            on_demand_percentage_above_base_capacity=25,
            spot_allocation_strategy="capacity-optimized",
        ),
        launch_template=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs(
            launch_template_specification=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs(
                launch_template_id=example_launch_template.id,
            ),
            overrides=[
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c4.large",
                    weighted_capacity="3",
                ),
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c3.large",
                    weighted_capacity="2",
                ),
            ],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("exampleLaunchTemplate", {
    namePrefix: "example",
    imageId: data.aws_ami.example.id,
    instanceType: "c5.large",
});
const exampleGroup = new aws.autoscaling.Group("exampleGroup", {
    capacityRebalance: true,
    desiredCapacity: 12,
    maxSize: 15,
    minSize: 12,
    vpcZoneIdentifiers: [
        aws_subnet.example1.id,
        aws_subnet.example2.id,
    ],
    mixedInstancesPolicy: {
        instancesDistribution: {
            onDemandBaseCapacity: 0,
            onDemandPercentageAboveBaseCapacity: 25,
            spotAllocationStrategy: "capacity-optimized",
        },
        launchTemplate: {
            launchTemplateSpecification: {
                launchTemplateId: exampleLaunchTemplate.id,
            },
            overrides: [
                {
                    instanceType: "c4.large",
                    weightedCapacity: "3",
                },
                {
                    instanceType: "c3.large",
                    weightedCapacity: "2",
                },
            ],
        },
    },
});

Mixed Instances Policy with Instance level LaunchTemplateSpecification Overrides

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleLaunchTemplate = new Aws.Ec2.LaunchTemplate("exampleLaunchTemplate", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "example",
            ImageId = data.Aws_ami.Example.Id,
            InstanceType = "c5.large",
        });
        var example2 = new Aws.Ec2.LaunchTemplate("example2", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "example2",
            ImageId = data.Aws_ami.Example2.Id,
        });
        var exampleGroup = new Aws.AutoScaling.Group("exampleGroup", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-east-1a",
            },
            DesiredCapacity = 1,
            MaxSize = 1,
            MinSize = 1,
            MixedInstancesPolicy = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyArgs
            {
                LaunchTemplate = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateArgs
                {
                    LaunchTemplateSpecification = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs
                    {
                        LaunchTemplateId = exampleLaunchTemplate.Id,
                    },
                    Overrides = 
                    {
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c4.large",
                            WeightedCapacity = "3",
                        },
                        new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs
                        {
                            InstanceType = "c6g.large",
                            LaunchTemplateSpecification = new Aws.AutoScaling.Inputs.GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecificationArgs
                            {
                                LaunchTemplateId = example2.Id,
                            },
                            WeightedCapacity = "2",
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleLaunchTemplate, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
			NamePrefix:   pulumi.String("example"),
			ImageId:      pulumi.Any(data.Aws_ami.Example.Id),
			InstanceType: pulumi.String("c5.large"),
		})
		if err != nil {
			return err
		}
		example2, err := ec2.NewLaunchTemplate(ctx, "example2", &ec2.LaunchTemplateArgs{
			NamePrefix: pulumi.String("example2"),
			ImageId:    pulumi.Any(data.Aws_ami.Example2.Id),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "exampleGroup", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			DesiredCapacity: pulumi.Int(1),
			MaxSize:         pulumi.Int(1),
			MinSize:         pulumi.Int(1),
			MixedInstancesPolicy: &autoscaling.GroupMixedInstancesPolicyArgs{
				LaunchTemplate: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs{
					LaunchTemplateSpecification: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs{
						LaunchTemplateId: exampleLaunchTemplate.ID(),
					},
					Overrides: autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArray{
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType:     pulumi.String("c4.large"),
							WeightedCapacity: pulumi.String("3"),
						},
						&autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs{
							InstanceType: pulumi.String("c6g.large"),
							LaunchTemplateSpecification: &autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecificationArgs{
								LaunchTemplateId: example2.ID(),
							},
							WeightedCapacity: pulumi.String("2"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_launch_template = aws.ec2.LaunchTemplate("exampleLaunchTemplate",
    name_prefix="example",
    image_id=data["aws_ami"]["example"]["id"],
    instance_type="c5.large")
example2 = aws.ec2.LaunchTemplate("example2",
    name_prefix="example2",
    image_id=data["aws_ami"]["example2"]["id"])
example_group = aws.autoscaling.Group("exampleGroup",
    availability_zones=["us-east-1a"],
    desired_capacity=1,
    max_size=1,
    min_size=1,
    mixed_instances_policy=aws.autoscaling.GroupMixedInstancesPolicyArgs(
        launch_template=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateArgs(
            launch_template_specification=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecificationArgs(
                launch_template_id=example_launch_template.id,
            ),
            overrides=[
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c4.large",
                    weighted_capacity="3",
                ),
                aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideArgs(
                    instance_type="c6g.large",
                    launch_template_specification=aws.autoscaling.GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecificationArgs(
                        launch_template_id=example2.id,
                    ),
                    weighted_capacity="2",
                ),
            ],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("exampleLaunchTemplate", {
    namePrefix: "example",
    imageId: data.aws_ami.example.id,
    instanceType: "c5.large",
});
const example2 = new aws.ec2.LaunchTemplate("example2", {
    namePrefix: "example2",
    imageId: data.aws_ami.example2.id,
});
const exampleGroup = new aws.autoscaling.Group("exampleGroup", {
    availabilityZones: ["us-east-1a"],
    desiredCapacity: 1,
    maxSize: 1,
    minSize: 1,
    mixedInstancesPolicy: {
        launchTemplate: {
            launchTemplateSpecification: {
                launchTemplateId: exampleLaunchTemplate.id,
            },
            overrides: [
                {
                    instanceType: "c4.large",
                    weightedCapacity: "3",
                },
                {
                    instanceType: "c6g.large",
                    launchTemplateSpecification: {
                        launchTemplateId: example2.id,
                    },
                    weightedCapacity: "2",
                },
            ],
        },
    },
});

Automatically refresh all instances after the group is updated

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleAmi = Output.Create(Aws.Ec2.GetAmi.InvokeAsync(new Aws.Ec2.GetAmiArgs
        {
            MostRecent = true,
            Owners = 
            {
                "amazon",
            },
            Filters = 
            {
                new Aws.Ec2.Inputs.GetAmiFilterArgs
                {
                    Name = "name",
                    Values = 
                    {
                        "amzn-ami-hvm-*-x86_64-gp2",
                    },
                },
            },
        }));
        var exampleLaunchTemplate = new Aws.Ec2.LaunchTemplate("exampleLaunchTemplate", new Aws.Ec2.LaunchTemplateArgs
        {
            ImageId = exampleAmi.Apply(exampleAmi => exampleAmi.Id),
            InstanceType = "t3.nano",
        });
        var exampleGroup = new Aws.AutoScaling.Group("exampleGroup", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-east-1a",
            },
            DesiredCapacity = 1,
            MaxSize = 2,
            MinSize = 1,
            LaunchTemplate = new Aws.AutoScaling.Inputs.GroupLaunchTemplateArgs
            {
                Id = exampleLaunchTemplate.Id,
                Version = exampleLaunchTemplate.LatestVersion,
            },
            Tags = 
            {
                new Aws.AutoScaling.Inputs.GroupTagArgs
                {
                    Key = "Key",
                    Value = "Value",
                    PropagateAtLaunch = true,
                },
            },
            InstanceRefresh = new Aws.AutoScaling.Inputs.GroupInstanceRefreshArgs
            {
                Strategy = "Rolling",
                Preferences = new Aws.AutoScaling.Inputs.GroupInstanceRefreshPreferencesArgs
                {
                    MinHealthyPercentage = 50,
                },
                Triggers = 
                {
                    "tag",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := true
		exampleAmi, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
			MostRecent: &opt0,
			Owners: []string{
				"amazon",
			},
			Filters: []ec2.GetAmiFilter{
				ec2.GetAmiFilter{
					Name: "name",
					Values: []string{
						"amzn-ami-hvm-*-x86_64-gp2",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleLaunchTemplate, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
			ImageId:      pulumi.String(exampleAmi.Id),
			InstanceType: pulumi.String("t3.nano"),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "exampleGroup", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			DesiredCapacity: pulumi.Int(1),
			MaxSize:         pulumi.Int(2),
			MinSize:         pulumi.Int(1),
			LaunchTemplate: &autoscaling.GroupLaunchTemplateArgs{
				Id:      exampleLaunchTemplate.ID(),
				Version: exampleLaunchTemplate.LatestVersion,
			},
			Tags: autoscaling.GroupTagArray{
				&autoscaling.GroupTagArgs{
					Key:               pulumi.String("Key"),
					Value:             pulumi.String("Value"),
					PropagateAtLaunch: pulumi.Bool(true),
				},
			},
			InstanceRefresh: &autoscaling.GroupInstanceRefreshArgs{
				Strategy: pulumi.String("Rolling"),
				Preferences: &autoscaling.GroupInstanceRefreshPreferencesArgs{
					MinHealthyPercentage: pulumi.Int(50),
				},
				Triggers: pulumi.StringArray{
					pulumi.String("tag"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_ami = aws.ec2.get_ami(most_recent=True,
    owners=["amazon"],
    filters=[aws.ec2.GetAmiFilterArgs(
        name="name",
        values=["amzn-ami-hvm-*-x86_64-gp2"],
    )])
example_launch_template = aws.ec2.LaunchTemplate("exampleLaunchTemplate",
    image_id=example_ami.id,
    instance_type="t3.nano")
example_group = aws.autoscaling.Group("exampleGroup",
    availability_zones=["us-east-1a"],
    desired_capacity=1,
    max_size=2,
    min_size=1,
    launch_template=aws.autoscaling.GroupLaunchTemplateArgs(
        id=example_launch_template.id,
        version=example_launch_template.latest_version,
    ),
    tags=[aws.autoscaling.GroupTagArgs(
        key="Key",
        value="Value",
        propagate_at_launch=True,
    )],
    instance_refresh=aws.autoscaling.GroupInstanceRefreshArgs(
        strategy="Rolling",
        preferences=aws.autoscaling.GroupInstanceRefreshPreferencesArgs(
            min_healthy_percentage=50,
        ),
        triggers=["tag"],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleAmi = aws.ec2.getAmi({
    mostRecent: true,
    owners: ["amazon"],
    filters: [{
        name: "name",
        values: ["amzn-ami-hvm-*-x86_64-gp2"],
    }],
});
const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("exampleLaunchTemplate", {
    imageId: exampleAmi.then(exampleAmi => exampleAmi.id),
    instanceType: "t3.nano",
});
const exampleGroup = new aws.autoscaling.Group("exampleGroup", {
    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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleLaunchTemplate = new Aws.Ec2.LaunchTemplate("exampleLaunchTemplate", new Aws.Ec2.LaunchTemplateArgs
        {
            NamePrefix = "example",
            ImageId = data.Aws_ami.Example.Id,
            InstanceType = "c5.large",
        });
        var exampleGroup = new Aws.AutoScaling.Group("exampleGroup", new Aws.AutoScaling.GroupArgs
        {
            AvailabilityZones = 
            {
                "us-east-1a",
            },
            DesiredCapacity = 1,
            MaxSize = 5,
            MinSize = 1,
            WarmPool = new Aws.AutoScaling.Inputs.GroupWarmPoolArgs
            {
                PoolState = "Stopped",
                MinSize = 1,
                MaxGroupPreparedCapacity = 10,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
			NamePrefix:   pulumi.String("example"),
			ImageId:      pulumi.Any(data.Aws_ami.Example.Id),
			InstanceType: pulumi.String("c5.large"),
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewGroup(ctx, "exampleGroup", &autoscaling.GroupArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			DesiredCapacity: pulumi.Int(1),
			MaxSize:         pulumi.Int(5),
			MinSize:         pulumi.Int(1),
			WarmPool: &autoscaling.GroupWarmPoolArgs{
				PoolState:                pulumi.String("Stopped"),
				MinSize:                  pulumi.Int(1),
				MaxGroupPreparedCapacity: pulumi.Int(10),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_launch_template = aws.ec2.LaunchTemplate("exampleLaunchTemplate",
    name_prefix="example",
    image_id=data["aws_ami"]["example"]["id"],
    instance_type="c5.large")
example_group = aws.autoscaling.Group("exampleGroup",
    availability_zones=["us-east-1a"],
    desired_capacity=1,
    max_size=5,
    min_size=1,
    warm_pool=aws.autoscaling.GroupWarmPoolArgs(
        pool_state="Stopped",
        min_size=1,
        max_group_prepared_capacity=10,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleLaunchTemplate = new aws.ec2.LaunchTemplate("exampleLaunchTemplate", {
    namePrefix: "example",
    imageId: data.aws_ami.example.id,
    instanceType: "c5.large",
});
const exampleGroup = new aws.autoscaling.Group("exampleGroup", {
    availabilityZones: ["us-east-1a"],
    desiredCapacity: 1,
    maxSize: 5,
    minSize: 1,
    warmPool: {
        poolState: "Stopped",
        minSize: 1,
        maxGroupPreparedCapacity: 10,
    },
});

Create a Group Resource

new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);
@overload
def Group(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          availability_zones: Optional[Sequence[str]] = None,
          capacity_rebalance: Optional[bool] = None,
          default_cooldown: Optional[int] = None,
          desired_capacity: Optional[int] = None,
          enabled_metrics: Optional[Sequence[str]] = None,
          force_delete: Optional[bool] = None,
          force_delete_warm_pool: Optional[bool] = None,
          health_check_grace_period: Optional[int] = None,
          health_check_type: Optional[str] = None,
          initial_lifecycle_hooks: Optional[Sequence[GroupInitialLifecycleHookArgs]] = None,
          instance_refresh: Optional[GroupInstanceRefreshArgs] = None,
          launch_configuration: Optional[str] = None,
          launch_template: Optional[GroupLaunchTemplateArgs] = None,
          load_balancers: Optional[Sequence[str]] = None,
          max_instance_lifetime: Optional[int] = None,
          max_size: Optional[int] = None,
          metrics_granularity: Optional[Union[str, MetricsGranularity]] = None,
          min_elb_capacity: Optional[int] = None,
          min_size: Optional[int] = None,
          mixed_instances_policy: Optional[GroupMixedInstancesPolicyArgs] = None,
          name: Optional[str] = None,
          name_prefix: Optional[str] = None,
          placement_group: Optional[str] = None,
          protect_from_scale_in: Optional[bool] = None,
          service_linked_role_arn: Optional[str] = None,
          suspended_processes: Optional[Sequence[str]] = None,
          tags: Optional[Sequence[GroupTagArgs]] = None,
          tags_collection: Optional[Sequence[Mapping[str, str]]] = None,
          target_group_arns: Optional[Sequence[str]] = None,
          termination_policies: Optional[Sequence[str]] = None,
          vpc_zone_identifiers: Optional[Sequence[str]] = None,
          wait_for_capacity_timeout: Optional[str] = None,
          wait_for_elb_capacity: Optional[int] = None,
          warm_pool: Optional[GroupWarmPoolArgs] = None)
@overload
def Group(resource_name: str,
          args: GroupArgs,
          opts: Optional[ResourceOptions] = None)
func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Group Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Group resource accepts the following input properties:

MaxSize int
The maximum size of the Auto Scaling Group.
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
AvailabilityZones List<string>
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
CapacityRebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
DefaultCooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
DesiredCapacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
EnabledMetrics List<string>
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
ForceDelete bool
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.
ForceDeleteWarmPool bool
HealthCheckGracePeriod int
Time (in seconds) after instance comes into service before checking health.
HealthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
InitialLifecycleHooks List<GroupInitialLifecycleHookArgs>
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
InstanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
LaunchConfiguration string | string
The name of the launch configuration to use.
LaunchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
LoadBalancers List<string>
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
MaxInstanceLifetime int
The 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.
MetricsGranularity string | Pulumi.Aws.AutoScaling.MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
MinElbCapacity int
Setting this causes the provider 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.)
MixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
NamePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
PlacementGroup string | string
The name of the placement group into which you’ll launch your instances, if any.
ProtectFromScaleIn bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
ServiceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
SuspendedProcesses List<string>
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
Tags List<GroupTagArgs>
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
TagsCollection List<ImmutableDictionary<string, string>>
Set of maps containing resource tags. Conflicts with tag. Documented below.
TargetGroupArns List<string>
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
TerminationPolicies List<string>
A 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.
VpcZoneIdentifiers List<string>
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
WaitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
WaitForElbCapacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
WarmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
MaxSize int
The maximum size of the Auto Scaling Group.
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
AvailabilityZones []string
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
CapacityRebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
DefaultCooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
DesiredCapacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
EnabledMetrics []string
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
ForceDelete bool
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.
ForceDeleteWarmPool bool
HealthCheckGracePeriod int
Time (in seconds) after instance comes into service before checking health.
HealthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
InitialLifecycleHooks []GroupInitialLifecycleHookArgs
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
InstanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
LaunchConfiguration string | string
The name of the launch configuration to use.
LaunchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
LoadBalancers []string
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
MaxInstanceLifetime int
The 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.
MetricsGranularity string | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
MinElbCapacity int
Setting this causes the provider 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.)
MixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
NamePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
PlacementGroup string | string
The name of the placement group into which you’ll launch your instances, if any.
ProtectFromScaleIn bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
ServiceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
SuspendedProcesses []string
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
Tags []GroupTagArgs
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
TagsCollection []map[string]string
Set of maps containing resource tags. Conflicts with tag. Documented below.
TargetGroupArns []string
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
TerminationPolicies []string
A 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.
VpcZoneIdentifiers []string
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
WaitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
WaitForElbCapacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
WarmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
maxSize number
The maximum size of the Auto Scaling Group.
minSize number
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
availabilityZones string[]
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
capacityRebalance boolean
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
defaultCooldown number
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
desiredCapacity number
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
enabledMetrics Metric[]
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
forceDelete boolean
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.
forceDeleteWarmPool boolean
healthCheckGracePeriod number
Time (in seconds) after instance comes into service before checking health.
healthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
initialLifecycleHooks GroupInitialLifecycleHookArgs[]
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
instanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
launchConfiguration string | LaunchConfiguration
The name of the launch configuration to use.
launchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
loadBalancers string[]
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
maxInstanceLifetime number
The 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.
metricsGranularity string | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
minElbCapacity number
Setting this causes the provider 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.)
mixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
namePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
placementGroup string | PlacementGroup
The name of the placement group into which you’ll launch your instances, if any.
protectFromScaleIn boolean
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
serviceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
suspendedProcesses string[]
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
tags GroupTagArgs[]
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
tagsCollection {[key: string]: string}[]
Set of maps containing resource tags. Conflicts with tag. Documented below.
targetGroupArns string[]
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
terminationPolicies string[]
A 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.
vpcZoneIdentifiers string[]
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
waitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
waitForElbCapacity number
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
warmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
max_size int
The maximum size of the Auto Scaling Group.
min_size int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
availability_zones Sequence[str]
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
capacity_rebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
default_cooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
desired_capacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
enabled_metrics Sequence[str]
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
force_delete bool
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.
force_delete_warm_pool bool
health_check_grace_period int
Time (in seconds) after instance comes into service before checking health.
health_check_type str
“EC2” or “ELB”. Controls how health checking is done.
initial_lifecycle_hooks Sequence[GroupInitialLifecycleHookArgs]
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
instance_refresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
launch_configuration str | str
The name of the launch configuration to use.
launch_template GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
load_balancers Sequence[str]
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
max_instance_lifetime int
The 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.
metrics_granularity str | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
min_elb_capacity int
Setting this causes the provider 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.)
mixed_instances_policy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
name str
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
name_prefix str
Creates a unique name beginning with the specified prefix. Conflicts with name.
placement_group str | str
The name of the placement group into which you’ll launch your instances, if any.
protect_from_scale_in bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
service_linked_role_arn str
The ARN of the service-linked role that the ASG will use to call other AWS services
suspended_processes Sequence[str]
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
tags Sequence[GroupTagArgs]
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
tags_collection Sequence[Mapping[str, str]]
Set of maps containing resource tags. Conflicts with tag. Documented below.
target_group_arns Sequence[str]
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
termination_policies Sequence[str]
A 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.
vpc_zone_identifiers Sequence[str]
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
wait_for_capacity_timeout str
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
wait_for_elb_capacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
warm_pool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below

Outputs

All input properties are implicitly available as output properties. Additionally, the Group resource produces the following output properties:

Arn string
The ARN for this Auto Scaling Group
Id string
The provider-assigned unique ID for this managed resource.
Arn string
The ARN for this Auto Scaling Group
Id string
The provider-assigned unique ID for this managed resource.
arn string
The ARN for this Auto Scaling Group
id string
The provider-assigned unique ID for this managed resource.
arn str
The ARN for this Auto Scaling Group
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Group Resource

Get an existing Group resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GroupState, opts?: CustomResourceOptions): Group
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        availability_zones: Optional[Sequence[str]] = None,
        capacity_rebalance: Optional[bool] = None,
        default_cooldown: Optional[int] = None,
        desired_capacity: Optional[int] = None,
        enabled_metrics: Optional[Sequence[str]] = None,
        force_delete: Optional[bool] = None,
        force_delete_warm_pool: Optional[bool] = None,
        health_check_grace_period: Optional[int] = None,
        health_check_type: Optional[str] = None,
        initial_lifecycle_hooks: Optional[Sequence[GroupInitialLifecycleHookArgs]] = None,
        instance_refresh: Optional[GroupInstanceRefreshArgs] = None,
        launch_configuration: Optional[str] = None,
        launch_template: Optional[GroupLaunchTemplateArgs] = None,
        load_balancers: Optional[Sequence[str]] = None,
        max_instance_lifetime: Optional[int] = None,
        max_size: Optional[int] = None,
        metrics_granularity: Optional[Union[str, MetricsGranularity]] = None,
        min_elb_capacity: Optional[int] = None,
        min_size: Optional[int] = None,
        mixed_instances_policy: Optional[GroupMixedInstancesPolicyArgs] = None,
        name: Optional[str] = None,
        name_prefix: Optional[str] = None,
        placement_group: Optional[str] = None,
        protect_from_scale_in: Optional[bool] = None,
        service_linked_role_arn: Optional[str] = None,
        suspended_processes: Optional[Sequence[str]] = None,
        tags: Optional[Sequence[GroupTagArgs]] = None,
        tags_collection: Optional[Sequence[Mapping[str, str]]] = None,
        target_group_arns: Optional[Sequence[str]] = None,
        termination_policies: Optional[Sequence[str]] = None,
        vpc_zone_identifiers: Optional[Sequence[str]] = None,
        wait_for_capacity_timeout: Optional[str] = None,
        wait_for_elb_capacity: Optional[int] = None,
        warm_pool: Optional[GroupWarmPoolArgs] = None) -> Group
func GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)
public static Group Get(string name, Input<string> id, GroupState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string
The ARN for this Auto Scaling Group
AvailabilityZones List<string>
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
CapacityRebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
DefaultCooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
DesiredCapacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
EnabledMetrics List<string>
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
ForceDelete bool
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.
ForceDeleteWarmPool bool
HealthCheckGracePeriod int
Time (in seconds) after instance comes into service before checking health.
HealthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
InitialLifecycleHooks List<GroupInitialLifecycleHookArgs>
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
InstanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
LaunchConfiguration string | string
The name of the launch configuration to use.
LaunchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
LoadBalancers List<string>
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
MaxInstanceLifetime int
The 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.
MaxSize int
The maximum size of the Auto Scaling Group.
MetricsGranularity string | Pulumi.Aws.AutoScaling.MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
MinElbCapacity int
Setting this causes the provider 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.)
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
MixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
NamePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
PlacementGroup string | string
The name of the placement group into which you’ll launch your instances, if any.
ProtectFromScaleIn bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
ServiceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
SuspendedProcesses List<string>
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
Tags List<GroupTagArgs>
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
TagsCollection List<ImmutableDictionary<string, string>>
Set of maps containing resource tags. Conflicts with tag. Documented below.
TargetGroupArns List<string>
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
TerminationPolicies List<string>
A 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.
VpcZoneIdentifiers List<string>
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
WaitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
WaitForElbCapacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
WarmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
Arn string
The ARN for this Auto Scaling Group
AvailabilityZones []string
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
CapacityRebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
DefaultCooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
DesiredCapacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
EnabledMetrics []string
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
ForceDelete bool
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.
ForceDeleteWarmPool bool
HealthCheckGracePeriod int
Time (in seconds) after instance comes into service before checking health.
HealthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
InitialLifecycleHooks []GroupInitialLifecycleHookArgs
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
InstanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
LaunchConfiguration string | string
The name of the launch configuration to use.
LaunchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
LoadBalancers []string
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
MaxInstanceLifetime int
The 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.
MaxSize int
The maximum size of the Auto Scaling Group.
MetricsGranularity string | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
MinElbCapacity int
Setting this causes the provider 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.)
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
MixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
NamePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
PlacementGroup string | string
The name of the placement group into which you’ll launch your instances, if any.
ProtectFromScaleIn bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
ServiceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
SuspendedProcesses []string
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
Tags []GroupTagArgs
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
TagsCollection []map[string]string
Set of maps containing resource tags. Conflicts with tag. Documented below.
TargetGroupArns []string
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
TerminationPolicies []string
A 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.
VpcZoneIdentifiers []string
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
WaitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
WaitForElbCapacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
WarmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
arn string
The ARN for this Auto Scaling Group
availabilityZones string[]
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
capacityRebalance boolean
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
defaultCooldown number
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
desiredCapacity number
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
enabledMetrics Metric[]
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
forceDelete boolean
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.
forceDeleteWarmPool boolean
healthCheckGracePeriod number
Time (in seconds) after instance comes into service before checking health.
healthCheckType string
“EC2” or “ELB”. Controls how health checking is done.
initialLifecycleHooks GroupInitialLifecycleHookArgs[]
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
instanceRefresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
launchConfiguration string | LaunchConfiguration
The name of the launch configuration to use.
launchTemplate GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
loadBalancers string[]
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
maxInstanceLifetime number
The 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.
maxSize number
The maximum size of the Auto Scaling Group.
metricsGranularity string | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
minElbCapacity number
Setting this causes the provider 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.)
minSize number
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
mixedInstancesPolicy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
namePrefix string
Creates a unique name beginning with the specified prefix. Conflicts with name.
placementGroup string | PlacementGroup
The name of the placement group into which you’ll launch your instances, if any.
protectFromScaleIn boolean
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
serviceLinkedRoleArn string
The ARN of the service-linked role that the ASG will use to call other AWS services
suspendedProcesses string[]
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
tags GroupTagArgs[]
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
tagsCollection {[key: string]: string}[]
Set of maps containing resource tags. Conflicts with tag. Documented below.
targetGroupArns string[]
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
terminationPolicies string[]
A 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.
vpcZoneIdentifiers string[]
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
waitForCapacityTimeout string
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
waitForElbCapacity number
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
warmPool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below
arn str
The ARN for this Auto Scaling Group
availability_zones Sequence[str]
A list of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with vpc_zone_identifier argument. Conflicts with vpc_zone_identifier.
capacity_rebalance bool
Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled.
default_cooldown int
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
desired_capacity int
The number of Amazon EC2 instances that should be running in the group. (See also Waiting for Capacity below.)
enabled_metrics Sequence[str]
A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances.
force_delete bool
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.
force_delete_warm_pool bool
health_check_grace_period int
Time (in seconds) after instance comes into service before checking health.
health_check_type str
“EC2” or “ELB”. Controls how health checking is done.
initial_lifecycle_hooks Sequence[GroupInitialLifecycleHookArgs]
One or more Lifecycle Hooks 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 autoscaling_group_name 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.
instance_refresh GroupInstanceRefreshArgs
If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated. Defined below.
launch_configuration str | str
The name of the launch configuration to use.
launch_template GroupLaunchTemplateArgs
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
load_balancers Sequence[str]
A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead.
max_instance_lifetime int
The 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.
max_size int
The maximum size of the Auto Scaling Group.
metrics_granularity str | MetricsGranularity
The granularity to associate with the metrics to collect. The only valid value is 1Minute. Default is 1Minute.
min_elb_capacity int
Setting this causes the provider 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.)
min_size int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
mixed_instances_policy GroupMixedInstancesPolicyArgs
Configuration block containing settings to define launch targets for Auto Scaling groups. See Mixed Instances Policy below for more details.
name str
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
name_prefix str
Creates a unique name beginning with the specified prefix. Conflicts with name.
placement_group str | str
The name of the placement group into which you’ll launch your instances, if any.
protect_from_scale_in bool
Allows setting instance protection. The Auto Scaling Group will not select instances with this setting for termination during scale in events.
service_linked_role_arn str
The ARN of the service-linked role that the ASG will use to call other AWS services
suspended_processes Sequence[str]
A list of processes to suspend for the Auto Scaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your Auto Scaling Group from functioning properly.
tags Sequence[GroupTagArgs]
Configuration block(s) containing resource tags. Conflicts with tags_collection. Documented below.
tags_collection Sequence[Mapping[str, str]]
Set of maps containing resource tags. Conflicts with tag. Documented below.
target_group_arns Sequence[str]
A set of aws.alb.TargetGroup ARNs, for use with Application or Network Load Balancing.
termination_policies Sequence[str]
A 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.
vpc_zone_identifiers Sequence[str]
A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones.
wait_for_capacity_timeout str
A maximum duration that this provider should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to “0” causes this provider to skip all Capacity Waiting behavior.
wait_for_elb_capacity int
Setting this will cause the provider 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 min_elb_capacity behavior.) (See also Waiting for Capacity below.)
warm_pool GroupWarmPoolArgs
If this block is configured, add a Warm Pool to the specified Auto Scaling group. Defined below

Supporting Types

GroupInitialLifecycleHook

LifecycleTransition string
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
DefaultResult string
HeartbeatTimeout int
NotificationMetadata string
NotificationTargetArn string
RoleArn string
LifecycleTransition string
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
DefaultResult string
HeartbeatTimeout int
NotificationMetadata string
NotificationTargetArn string
RoleArn string
lifecycleTransition string
name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
defaultResult string
heartbeatTimeout number
notificationMetadata string
notificationTargetArn string
roleArn string
lifecycle_transition str
name str
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
default_result str
heartbeat_timeout int
notification_metadata str
notification_target_arn str
role_arn str

GroupInstanceRefresh

Strategy string
The strategy to use for instance refresh. The only allowed value is Rolling. See StartInstanceRefresh Action for more information.
Preferences GroupInstanceRefreshPreferences
Override default parameters for Instance Refresh.
Triggers List<string>
Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.
Strategy string
The strategy to use for instance refresh. The only allowed value is Rolling. See StartInstanceRefresh Action for more information.
Preferences GroupInstanceRefreshPreferences
Override default parameters for Instance Refresh.
Triggers []string
Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.
strategy string
The strategy to use for instance refresh. The only allowed value is Rolling. See StartInstanceRefresh Action for more information.
preferences GroupInstanceRefreshPreferences
Override default parameters for Instance Refresh.
triggers string[]
Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.
strategy str
The strategy to use for instance refresh. The only allowed value is Rolling. See StartInstanceRefresh Action for more information.
preferences GroupInstanceRefreshPreferences
Override default parameters for Instance Refresh.
triggers Sequence[str]
Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.

GroupInstanceRefreshPreferences

InstanceWarmup string
The number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group’s health check grace period.
MinHealthyPercentage int
The amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to 90.
InstanceWarmup string
The number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group’s health check grace period.
MinHealthyPercentage int
The amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to 90.
instanceWarmup string
The number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group’s health check grace period.
minHealthyPercentage number
The amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to 90.
instance_warmup str
The number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group’s health check grace period.
min_healthy_percentage int
The amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to 90.

GroupLaunchTemplate

Id string
The ID of the launch template. Conflicts with name.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
Id string
The ID of the launch template. Conflicts with name.
Name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
id string
The ID of the launch template. Conflicts with name.
name string
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
id str
The ID of the launch template. Conflicts with name.
name str
The name of the Auto Scaling Group. By default generated by this provider. Conflicts with name_prefix.
version str
Template version. Can be version number, $Latest, or $Default. (Default: $Default).

GroupMixedInstancesPolicy

LaunchTemplate GroupMixedInstancesPolicyLaunchTemplate
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
InstancesDistribution GroupMixedInstancesPolicyInstancesDistribution
Nested argument containing settings on how to mix on-demand and Spot instances in the Auto Scaling group. Defined below.
LaunchTemplate GroupMixedInstancesPolicyLaunchTemplate
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
InstancesDistribution GroupMixedInstancesPolicyInstancesDistribution
Nested argument containing settings on how to mix on-demand and Spot instances in the Auto Scaling group. Defined below.
launchTemplate GroupMixedInstancesPolicyLaunchTemplate
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
instancesDistribution GroupMixedInstancesPolicyInstancesDistribution
Nested argument containing settings on how to mix on-demand and Spot instances in the Auto Scaling group. Defined below.
launch_template GroupMixedInstancesPolicyLaunchTemplate
Nested argument containing launch template settings along with the overrides to specify multiple instance types and weights. Defined below.
instances_distribution GroupMixedInstancesPolicyInstancesDistribution
Nested argument containing settings on how to mix on-demand and Spot instances in the Auto Scaling group. Defined below.

GroupMixedInstancesPolicyInstancesDistribution

OnDemandAllocationStrategy string
Strategy to use when launching on-demand instances. Valid values: prioritized. Default: prioritized.
OnDemandBaseCapacity int
Absolute minimum amount of desired capacity that must be fulfilled by on-demand instances. Default: 0.
OnDemandPercentageAboveBaseCapacity int
Percentage split between on-demand and Spot instances above the base on-demand capacity. Default: 100.
SpotAllocationStrategy string
How to allocate capacity across the Spot pools. Valid values: lowest-price, capacity-optimized, capacity-optimized-prioritized. Default: lowest-price.
SpotInstancePools int
Number of Spot pools per availability zone to allocate capacity. EC2 Auto Scaling selects the cheapest Spot pools and evenly allocates Spot capacity across the number of Spot pools that you specify. Default: 2.
SpotMaxPrice string
Maximum price per unit hour that the user is willing to pay for the Spot instances. Default: an empty string which means the on-demand price.
OnDemandAllocationStrategy string
Strategy to use when launching on-demand instances. Valid values: prioritized. Default: prioritized.
OnDemandBaseCapacity int
Absolute minimum amount of desired capacity that must be fulfilled by on-demand instances. Default: 0.
OnDemandPercentageAboveBaseCapacity int
Percentage split between on-demand and Spot instances above the base on-demand capacity. Default: 100.
SpotAllocationStrategy string
How to allocate capacity across the Spot pools. Valid values: lowest-price, capacity-optimized, capacity-optimized-prioritized. Default: lowest-price.
SpotInstancePools int
Number of Spot pools per availability zone to allocate capacity. EC2 Auto Scaling selects the cheapest Spot pools and evenly allocates Spot capacity across the number of Spot pools that you specify. Default: 2.
SpotMaxPrice string
Maximum price per unit hour that the user is willing to pay for the Spot instances. Default: an empty string which means the on-demand price.
onDemandAllocationStrategy string
Strategy to use when launching on-demand instances. Valid values: prioritized. Default: prioritized.
onDemandBaseCapacity number
Absolute minimum amount of desired capacity that must be fulfilled by on-demand instances. Default: 0.
onDemandPercentageAboveBaseCapacity number
Percentage split between on-demand and Spot instances above the base on-demand capacity. Default: 100.
spotAllocationStrategy string
How to allocate capacity across the Spot pools. Valid values: lowest-price, capacity-optimized, capacity-optimized-prioritized. Default: lowest-price.
spotInstancePools number
Number of Spot pools per availability zone to allocate capacity. EC2 Auto Scaling selects the cheapest Spot pools and evenly allocates Spot capacity across the number of Spot pools that you specify. Default: 2.
spotMaxPrice string
Maximum price per unit hour that the user is willing to pay for the Spot instances. Default: an empty string which means the on-demand price.
on_demand_allocation_strategy str
Strategy to use when launching on-demand instances. Valid values: prioritized. Default: prioritized.
on_demand_base_capacity int
Absolute minimum amount of desired capacity that must be fulfilled by on-demand instances. Default: 0.
on_demand_percentage_above_base_capacity int
Percentage split between on-demand and Spot instances above the base on-demand capacity. Default: 100.
spot_allocation_strategy str
How to allocate capacity across the Spot pools. Valid values: lowest-price, capacity-optimized, capacity-optimized-prioritized. Default: lowest-price.
spot_instance_pools int
Number of Spot pools per availability zone to allocate capacity. EC2 Auto Scaling selects the cheapest Spot pools and evenly allocates Spot capacity across the number of Spot pools that you specify. Default: 2.
spot_max_price str
Maximum price per unit hour that the user is willing to pay for the Spot instances. Default: an empty string which means the on-demand price.

GroupMixedInstancesPolicyLaunchTemplate

LaunchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
Overrides List<GroupMixedInstancesPolicyLaunchTemplateOverride>
List of nested arguments provides the ability to specify multiple instance types. This will override the same parameter in the launch template. For on-demand instances, Auto Scaling considers the order of preference of instance types to launch based on the order specified in the overrides list. Defined below.
LaunchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
Overrides []GroupMixedInstancesPolicyLaunchTemplateOverride
List of nested arguments provides the ability to specify multiple instance types. This will override the same parameter in the launch template. For on-demand instances, Auto Scaling considers the order of preference of instance types to launch based on the order specified in the overrides list. Defined below.
launchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
overrides GroupMixedInstancesPolicyLaunchTemplateOverride[]
List of nested arguments provides the ability to specify multiple instance types. This will override the same parameter in the launch template. For on-demand instances, Auto Scaling considers the order of preference of instance types to launch based on the order specified in the overrides list. Defined below.
launch_template_specification GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
overrides Sequence[GroupMixedInstancesPolicyLaunchTemplateOverride]
List of nested arguments provides the ability to specify multiple instance types. This will override the same parameter in the launch template. For on-demand instances, Auto Scaling considers the order of preference of instance types to launch based on the order specified in the overrides list. Defined below.

GroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification

LaunchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
LaunchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
LaunchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
LaunchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
launchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
launchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
launch_template_id str
The ID of the launch template. Conflicts with launch_template_name.
launch_template_name str
The name of the launch template. Conflicts with launch_template_id.
version str
Template version. Can be version number, $Latest, or $Default. (Default: $Default).

GroupMixedInstancesPolicyLaunchTemplateOverride

InstanceType string
Override the instance type in the Launch Template.
LaunchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
WeightedCapacity string
The number of capacity units, which gives the instance type a proportional weight to other instance types.
InstanceType string
Override the instance type in the Launch Template.
LaunchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
WeightedCapacity string
The number of capacity units, which gives the instance type a proportional weight to other instance types.
instanceType string
Override the instance type in the Launch Template.
launchTemplateSpecification GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
weightedCapacity string
The number of capacity units, which gives the instance type a proportional weight to other instance types.
instance_type str
Override the instance type in the Launch Template.
launch_template_specification GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecification
Override the instance launch template specification in the Launch Template.
weighted_capacity str
The number of capacity units, which gives the instance type a proportional weight to other instance types.

GroupMixedInstancesPolicyLaunchTemplateOverrideLaunchTemplateSpecification

LaunchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
LaunchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
LaunchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
LaunchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
Version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
launchTemplateId string
The ID of the launch template. Conflicts with launch_template_name.
launchTemplateName string
The name of the launch template. Conflicts with launch_template_id.
version string
Template version. Can be version number, $Latest, or $Default. (Default: $Default).
launch_template_id str
The ID of the launch template. Conflicts with launch_template_name.
launch_template_name str
The name of the launch template. Conflicts with launch_template_id.
version str
Template version. Can be version number, $Latest, or $Default. (Default: $Default).

GroupTag

Key string
Key
PropagateAtLaunch bool
Enables propagation of the tag to Amazon EC2 instances launched via this ASG
Value string
Value
Key string
Key
PropagateAtLaunch bool
Enables propagation of the tag to Amazon EC2 instances launched via this ASG
Value string
Value
key string
Key
propagateAtLaunch boolean
Enables propagation of the tag to Amazon EC2 instances launched via this ASG
value string
Value
key str
Key
propagate_at_launch bool
Enables propagation of the tag to Amazon EC2 instances launched via this ASG
value str
Value

GroupWarmPool

MaxGroupPreparedCapacity int
Specifies the total maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
PoolState string
Sets the instance state to transition to after the lifecycle hooks finish. Valid values are: Stopped (default) or Running.
MaxGroupPreparedCapacity int
Specifies the total maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.
MinSize int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
PoolState string
Sets the instance state to transition to after the lifecycle hooks finish. Valid values are: Stopped (default) or Running.
maxGroupPreparedCapacity number
Specifies the total maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.
minSize number
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
poolState string
Sets the instance state to transition to after the lifecycle hooks finish. Valid values are: Stopped (default) or Running.
max_group_prepared_capacity int
Specifies the total maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.
min_size int
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
pool_state str
Sets the instance state to transition to after the lifecycle hooks finish. Valid values are: Stopped (default) or Running.

MetricsGranularity

OneMinute
1Minute
MetricsGranularityOneMinute
1Minute
OneMinute
1Minute
ONE_MINUTE
1Minute

Import

Auto Scaling Groups can be imported using the name, e.g.

 $ pulumi import aws:autoscaling/group:Group web web-asg

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.