aws::autoscaling-group

Creates an Auto scaling Group from a Launch Configuration or from a Launch Template.

Example

aws::autoscaling-group auto-scaling-group-example
    name: "auto-scaling-group-gyro-1"
    launch-configuration: $(aws::launch-configuration launch-configuration-auto-scaling-group-example)
    availability-zones: [
        $(aws::subnet subnet-auto-scaling-group-example | availability-zone)
    ]
end
aws::autoscaling-group auto-scaling-group-example
    name: "auto-scaling-group-gyro-1"
    launch-template: $(aws::launch-template launch-template-auto-scaling-group-example)
    availability-zones: [
        $(aws::subnet subnet-auto-scaling-group-example | availability-zone),
        $(aws::subnet subnet-auto-scaling-group-example-2 | availability-zone)
    ]

    scaling-policy
        policy-name: "Simple-Policy-1"
        adjustment-type: "PercentChangeInCapacity"
        policy-type: "SimpleScaling"
        cooldown: 3000
        scaling-adjustment: 5
        min-adjustment-magnitude: 3
    end

    lifecycle-hook
        lifecycle-hook-name: "Lifecycle-Hook-1"
        default-result: "CONTINUE"
        heartbeat-timeout: 300
        lifecycle-transition: "autoscaling:EC2_INSTANCE_LAUNCHING"
    end

    auto-scaling-notification
        topic: "arn:aws:sns:us-west-2:242040583208:gyro-instance-state"
        notification-type: "autoscaling:EC2_INSTANCE_LAUNCH_ERROR"
    end

end

Attributes

Attribute Description
name The name of the Auto Scaling Group, also serves as its identifier and thus unique. (Required)
launch-template The ID of an launched template that would be used as a skeleton to create the Auto scaling group. Required if launch configuration name not provided.
availability-zones set The set of availability zones for the Auto Scaling group to be active in. See Distributing Instances Across Availability Zones.
capacity-rebalance When set to true capacity rebalancing is enabled for the Auto Scaling group.
max-instance-lifetime The maximum amount of time that an instance can stay in service for the Auto Scaling group.
max-size The maximum number of instances for the Auto Scaling group. Minimum allowed value is 0. (Required)
min-size The minimum number of instances for the Auto Scaling group. Minimum allowed value is 0. (Required)
desired-capacity The desired number of instances for the Auto Scaling group.
default-cooldown The default cool down period in sec for the Auto Scaling group. Defaults to 300 sec. Minimum allowed value is 0. See Default Cool downs.
health-check-type The type of health check to be performed on the Auto Scaling group. Defaults to EC2. Valid values are ELB or EC2. See Health Checks for Auto Scaling Instances.
health-check-grace-period The grace period after which health check is started, to give time for the Instances in the Auto scaling group to start up. Defaults to 0 sec. Minimum allowed value is 0. See Health Checks for Auto Scaling Instances.
launch-configuration The name of a launched configuration that would be used as a skeleton to create the Auto scaling group. Required if launch template Id is not provided.
mixed-instances-policy subresource

The mixed instances policy of the Auto Scaling group.

instances-distribution subresource

The instances distribution of the mixed instances policy.

on-demand-allocation-strategy
The strategy on how to allocate instance types to fulfill On-Demand capacity. Currently the only supported value is prioritized.
on-demand-base-capacity
The minimum amount of the Auto Scaling group’s capacity that must be fulfilled by On-Demand Instances.
on-demand-percentage-above-base-capacity
The percentages of On-Demand Instances and Spot Instances for additional capacity above onDemandBaseCapacity.
spot-allocation-strategy
The strategy on how to allocate instances across Spot Instance pools. Valid values are lowest-price or capacity-optimized.
spot-instance-pools
The number of Spot Instance pools. Valid values are between 1 to 20.
spot-max-price
The maximum price for a Spot Instance.
launch-template
The launch template that would be used as a skeleton to create the Auto Scaling group.
new-instances-protected-from-scale-in When set to true, protection of instances from Auto Scale Group scale in is enabled. Defaults to false. see Controlling Which Auto Scaling Instances Terminate During Scale In.
subnets set The list of subnet’s. If Availability Zone is provided, subnet’s need to be part of that. See Launching Auto Scaling Instances in a VPC.
enable-metrics-collection When set to true, cloud watch metrics for your Auto Scaling Group are enabled. Defaults to false. See Monitoring your Auto Scaling Groups.
disabled-metrics set The list of cloud watch metrics to be disabled for the Auto Scaling Group. Valid values are GroupMinSize, GroupMaxSize, GroupDesiredCapacity, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances and GroupTotalInstances. See Cloud watch metrics.
tags map The tags for Auto Scaling Groups. See Tagging Auto Scaling Groups and Instances.
propagate-at-launch-tags set The tags in Auto Scaling Groups that the instances need to have as well. See Tagging Auto Scaling Groups and Instances.
service-linked-role-arn The arn of the service-linked role that the Auto Scaling Group uses to call other AWS services.
placement-group The name of the placement group into which to launch the instances for the Auto Scaling Group.
instance The Instance used to create a launch configuration for the Auto Scaling Group.
classic-load-balancers set The set of classic load balancers to be attached to the Auto Scaling Group.
target-groups set The set of target groups for the Auto Scaling Group.
termination-policies set The set of termination policies for the Auto Scaling Group.
scaling-policy set subresource

The set of policies to trigger for the Auto Scaling Group.

policy-name
The name of the policy. (Required)
adjustment-type
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity or PercentChangeInCapacity.
cooldown
The amount of time between two scaling events. Minimum allowed value is 0.
enabled
When set to true the scaling policy is enabled.
estimated-instance-warmup
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. Minimum allowed value is 0.
metric-aggregation-type
The aggregation type for cloud watch metrics. Defaults to Average. Valid values are Minimum, Maximum or Average.
min-adjustment-magnitude
The minimum number of instances to scale.
policy-type
The type of policy. Defaults to SimpleScaling. Valid values are SimpleScaling, StepScaling or TargetTrackingScaling.
scaling-adjustment
The amount by which the scaling would happen.
disable-scale-in
When set to true, scaling in by the target tracking policy is enabled. Defaulted to false.
target-value
The target value for the metric.
predefined-metric-type
The predefined metric type.
predefined-metric-resource-label
The predefined defines metric resource label. Valid values are ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut or ALBRequestCountPerTarget.
step-adjustment set subresource

The set of adjustments that enable you to scale based on the size of the alarm breach.

scaling-adjustment
The amount of scaling adjustment.
metric-interval-lower-bound
The lower bound for the scaling adjustment.
metric-interval-upper-bound
The upper bound for the scaling adjustment.
target-tracking-configuration subresource

The target tracking configurations for the scaling policy.

customized-scaling-metric-specification subresource

The customized metric.

dimensions list subresource

The dimensions of the metric.

name
The name of the dimension. (Required)
value
The value of the dimension. (Required)
name
The name of the metric. (Required)
namespace
The namespace of the metric. (Required)
statistic
The statistic of the metric. (Required)
unit
The unit of the metric.
disable-scale-in
When set to true, the scale in by the target tracking scaling policy is disabled.
estimated-instance-warmup
The estimated time (in seconds) until a new instance can contribute to the CloudWatch metrics.
predefined-scaling-metric-specification subresource

The predefined metric specification.

predefined-scaling-metric-type
The metric type. Valid values are ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, DynamoDBReadCapacityUtilization, DynamoDBWriteCapacityUtilization, ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, ALBRequestCountPerTarget, RDSReaderAverageCPUUtilization, RDSReaderAverageDatabaseConnections, EC2SpotFleetRequestAverageCPUUtilization, EC2SpotFleetRequestAverageNetworkIn or EC2SpotFleetRequestAverageNetworkOuts. (Required)
resource-label
The resource associated with the metric type.
scale-in-cooldown
The amount of time, in seconds, after a scale in activity completes before another can start.
scale-out-cooldown
The amount of time in seconds, after a scale out activity completes before another can start.
target-value
The target value for the metric.
lifecycle-hook set subresource

A set of Life cycle hooks for the Auto Scaling Group.

lifecycle-hook-name
The name of the lifecycle hook. (Required)
default-result
The action the Auto Scaling group should take when the lifecycle hook timeout elapses. Defaults to ABANDON. Valid values are CONTINUE or ABANDON.
heartbeat-timeout
The max time in seconds after which the lifecycle hook times out. Defaults to 3600. Valid values are between 30 to 7200.
lifecycle-transition
The instance state to which this lifecycle hook is being attached. Defaults to autoscaling:EC2_INSTANCE_LAUNCHING. Valid values are autoscaling:EC2_INSTANCE_LAUNCHING or autoscaling:EC2_INSTANCE_TERMINATING.
notification-metadata
The additional information to be included in the notification to the notification target.
notification-target-arn
The arn of the notification target. Can be SQS or SNS.
role
The IAM role that allows publication to the specified notification target.
scheduled-action set subresource

The set of scheduled actions for the Auto Scaling Group.

scheduled-action-name
The scheduled action name. (Required)
desired-capacity
The desired capacity of instances this scheduled action to scale to. Minimum allowed value is 0.
max-size
The maximum number of instances this scheduled action to scale to. Minimum allowed value is 0.
min-size
The minimum number of instances this scheduled action to scale to. Minimum allowed value is 0.
recurrence
The recurring schedule for this action, in Unix cron syntax format
start-time
The time for this action to start.
end-time
The time for this action to stop.
auto-scaling-notification set subresource

The set of notifications for the Auto Scaling Group.

topic
The SNS topic to notify. (Required)
notification-type
The event on which to notify. Valid values are autoscaling:EC2_INSTANCE_LAUNCH, autoscaling:EC2_INSTANCE_LAUNCH_ERROR, autoscaling:EC2_INSTANCE_TERMINATE or autoscaling:EC2_INSTANCE_TERMINATE_ERROR. (Required)

Outputs

Attribute Description
arn The arn of the Auto Scaling Group.
status The status of the Auto Scaling Group.
created-time The create time of the Auto Scaling Group.