API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type CreateAutoScalingGroupInput struct { AutoScalingGroupName *string `min:"1" type:"string" required:"true"` AvailabilityZones []*string `min:"1" type:"list"` DefaultCooldown *int64 `type:"integer"` DesiredCapacity *int64 `type:"integer"` HealthCheckGracePeriod *int64 `type:"integer"` HealthCheckType *string `min:"1" type:"string"` InstanceId *string `min:"1" type:"string"` LaunchConfigurationName *string `min:"1" type:"string"` LaunchTemplate *LaunchTemplateSpecification `type:"structure"` LifecycleHookSpecificationList []*LifecycleHookSpecification `type:"list"` LoadBalancerNames []*string `type:"list"` MaxSize *int64 `type:"integer" required:"true"` MinSize *int64 `type:"integer" required:"true"` MixedInstancesPolicy *MixedInstancesPolicy `type:"structure"` NewInstancesProtectedFromScaleIn *bool `type:"boolean"` PlacementGroup *string `min:"1" type:"string"` ServiceLinkedRoleARN *string `min:"1" type:"string"` Tags []*Tag `type:"list"` TargetGroupARNs []*string `type:"list"` TerminationPolicies []*string `type:"list"` VPCZoneIdentifier *string `min:"1" type:"string"` }


Type: *string

The name of the Auto Scaling group. This name must be unique within the scope of your AWS account.

AutoScalingGroupName is a required field


Type: []*string

One or more Availability Zones for the group. This parameter is optional if you specify one or more subnets.


Type: *int64

The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default is 300.

For more information, see Scaling Cooldowns ( in the Amazon EC2 Auto Scaling User Guide.


Type: *int64

The number of EC2 instances that should be running in the group. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.


Type: *int64

The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service. During this time, any health check failures for the instance are ignored. The default is 0.

This parameter is required if you are adding an ELB health check.

For more information, see Health Checks ( in the Amazon EC2 Auto Scaling User Guide.


Type: *string

The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks ( in the Amazon EC2 Auto Scaling User Guide.


Type: *string

The ID of the instance used to create a launch configuration for the group. This parameter, a launch configuration, a launch template, or a mixed instances policy must be specified.

When you specify an ID of an instance, Amazon EC2 Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, except for the block device mapping.

For more information, see Create an Auto Scaling Group Using an EC2 Instance ( in the Amazon EC2 Auto Scaling User Guide.


Type: *string

The name of the launch configuration. This parameter, a launch template, a mixed instances policy, or an EC2 instance must be specified.


Describes a launch template and the launch template version.

The launch template that is specified must be configured for use with an Auto Scaling group. For more information, see Creating a Launch Template for an Auto Scaling group ( in the Amazon EC2 Auto Scaling User Guide.


Describes a lifecycle hook, which tells Amazon EC2 Auto Scaling that you want to perform an action whenever it launches instances or whenever it terminates instances.

For more information, see Amazon EC2 Auto Scaling Lifecycle Hooks ( in the Amazon EC2 Auto Scaling User Guide.


Type: []*string

One or more Classic Load Balancers. To specify an Application Load Balancer or a Network Load Balancer, use TargetGroupARNs instead.

For more information, see Using a Load Balancer With an Auto Scaling Group ( in the Amazon EC2 Auto Scaling User Guide.


Type: *int64

The maximum size of the group.

MaxSize is a required field


Type: *int64

The minimum size of the group.

MinSize is a required field


Describes a mixed instances policy for an Auto Scaling group. With mixed instances, your Auto Scaling group can provision a combination of On-Demand Instances and Spot Instances across multiple instance types. For more information, see Using Multiple Instance Types and Purchase Options ( in the Amazon EC2 Auto Scaling User Guide.

When you create your Auto Scaling group, you can specify a launch configuration or template as a parameter for the top-level object, or you can specify a mixed instances policy, but not both at the same time.


Type: *bool

Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

For more information about preventing instances from terminating on scale in, see Instance Protection ( in the Amazon EC2 Auto Scaling User Guide.


Type: *string

The name of the placement group into which to launch your instances, if any. For more information, see Placement Groups ( in the Amazon EC2 User Guide for Linux Instances.


Type: *string

The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, which it creates if it does not exist.


Describes a tag for an Auto Scaling group.


Type: []*string

The Amazon Resource Names (ARN) of the target groups.


Type: []*string

One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Controlling Which Instances Auto Scaling Terminates During Scale In ( in the Amazon EC2 Auto Scaling User Guide.


Type: *string

A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Launching Auto Scaling Instances in a VPC ( in the Amazon EC2 Auto Scaling User Guide.



func (s CreateAutoScalingGroupInput) GoString() string

GoString returns the string representation


func (s *CreateAutoScalingGroupInput) SetAutoScalingGroupName(v string) *CreateAutoScalingGroupInput

SetAutoScalingGroupName sets the AutoScalingGroupName field's value.


func (s *CreateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *CreateAutoScalingGroupInput

SetAvailabilityZones sets the AvailabilityZones field's value.


func (s *CreateAutoScalingGroupInput) SetDefaultCooldown(v int64) *CreateAutoScalingGroupInput

SetDefaultCooldown sets the DefaultCooldown field's value.


func (s *CreateAutoScalingGroupInput) SetDesiredCapacity(v int64) *CreateAutoScalingGroupInput

SetDesiredCapacity sets the DesiredCapacity field's value.


func (s *CreateAutoScalingGroupInput) SetHealthCheckGracePeriod(v int64) *CreateAutoScalingGroupInput

SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value.


func (s *CreateAutoScalingGroupInput) SetHealthCheckType(v string) *CreateAutoScalingGroupInput

SetHealthCheckType sets the HealthCheckType field's value.


func (s *CreateAutoScalingGroupInput) SetInstanceId(v string) *CreateAutoScalingGroupInput

SetInstanceId sets the InstanceId field's value.


func (s *CreateAutoScalingGroupInput) SetLaunchConfigurationName(v string) *CreateAutoScalingGroupInput

SetLaunchConfigurationName sets the LaunchConfigurationName field's value.


func (s *CreateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *CreateAutoScalingGroupInput

SetLaunchTemplate sets the LaunchTemplate field's value.


func (s *CreateAutoScalingGroupInput) SetLifecycleHookSpecificationList(v []*LifecycleHookSpecification) *CreateAutoScalingGroupInput

SetLifecycleHookSpecificationList sets the LifecycleHookSpecificationList field's value.


func (s *CreateAutoScalingGroupInput) SetLoadBalancerNames(v []*string) *CreateAutoScalingGroupInput

SetLoadBalancerNames sets the LoadBalancerNames field's value.


func (s *CreateAutoScalingGroupInput) SetMaxSize(v int64) *CreateAutoScalingGroupInput

SetMaxSize sets the MaxSize field's value.


func (s *CreateAutoScalingGroupInput) SetMinSize(v int64) *CreateAutoScalingGroupInput

SetMinSize sets the MinSize field's value.


func (s *CreateAutoScalingGroupInput) SetMixedInstancesPolicy(v *MixedInstancesPolicy) *CreateAutoScalingGroupInput

SetMixedInstancesPolicy sets the MixedInstancesPolicy field's value.


func (s *CreateAutoScalingGroupInput) SetNewInstancesProtectedFromScaleIn(v bool) *CreateAutoScalingGroupInput

SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value.


func (s *CreateAutoScalingGroupInput) SetPlacementGroup(v string) *CreateAutoScalingGroupInput

SetPlacementGroup sets the PlacementGroup field's value.


func (s *CreateAutoScalingGroupInput) SetServiceLinkedRoleARN(v string) *CreateAutoScalingGroupInput

SetServiceLinkedRoleARN sets the ServiceLinkedRoleARN field's value.


func (s *CreateAutoScalingGroupInput) SetTags(v []*Tag) *CreateAutoScalingGroupInput

SetTags sets the Tags field's value.


func (s *CreateAutoScalingGroupInput) SetTargetGroupARNs(v []*string) *CreateAutoScalingGroupInput

SetTargetGroupARNs sets the TargetGroupARNs field's value.


func (s *CreateAutoScalingGroupInput) SetTerminationPolicies(v []*string) *CreateAutoScalingGroupInput

SetTerminationPolicies sets the TerminationPolicies field's value.


func (s *CreateAutoScalingGroupInput) SetVPCZoneIdentifier(v string) *CreateAutoScalingGroupInput

SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value.


func (s CreateAutoScalingGroupInput) String() string

String returns the string representation


func (s *CreateAutoScalingGroupInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: