github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/website/source/docs/providers/aws/r/autoscaling_policy.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_autoscaling_policy" 4 sidebar_current: "docs-aws-resource-autoscaling-policy" 5 description: |- 6 Provides an AutoScaling Scaling Group resource. 7 --- 8 9 # aws\_autoscaling\_policy 10 11 Provides an AutoScaling Scaling Policy resource. 12 13 ~> **NOTE:** You may want to omit `desired_capacity` attribute from attached `aws_autoscaling_group` 14 when using autoscaling policies. It's good practice to pick either 15 [manual](http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-manual-scaling.html) 16 or [dynamic](http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html) 17 (policy-based) scaling. 18 19 ## Example Usage 20 ``` 21 resource "aws_autoscaling_policy" "bat" { 22 name = "foobar3-terraform-test" 23 scaling_adjustment = 4 24 adjustment_type = "ChangeInCapacity" 25 cooldown = 300 26 autoscaling_group_name = "${aws_autoscaling_group.bar.name}" 27 } 28 29 resource "aws_autoscaling_group" "bar" { 30 availability_zones = ["us-east-1a"] 31 name = "foobar3-terraform-test" 32 max_size = 5 33 min_size = 2 34 health_check_grace_period = 300 35 health_check_type = "ELB" 36 force_delete = true 37 launch_configuration = "${aws_launch_configuration.foo.name}" 38 } 39 ``` 40 41 ## Argument Reference 42 43 The following arguments are supported: 44 45 * `name` - (Required) The name of the policy. 46 * `autoscaling_group_name` - (Required) The name or ARN of the group. 47 * `adjustment_type` - (Required) Specifies whether the `scaling_adjustment` is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`. 48 * `scaling_adjustment` - (Required) The number of instances by which to scale. `adjustment_type` determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity. 49 * `cooldown` - (Optional) The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. 50 * `min_adjustment_step` - (Optional) Used with `adjustment_type` with the value `PercentChangeInCapacity`, the scaling policy changes the `desired_capacity` of the Auto Scaling group by at least the number of instances specified in the value. 51 52 ## Attribute Reference 53 * `arn` - The ARN assigned by AWS to the scaling policy.