github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/appautoscaling_policy.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_appautoscaling_policy"
     4  sidebar_current: "docs-aws-resource-appautoscaling-policy"
     5  description: |-
     6    Provides an Application AutoScaling Policy resource.
     7  ---
     8  
     9  # aws\_appautoscaling\_policy
    10  
    11  Provides an Application AutoScaling Policy resource.
    12  
    13  ## Example Usage
    14  ```
    15  resource "aws_appautoscaling_policy" "down" {
    16    name = "scale-down"
    17    service_namespace = "ecs"
    18    resource_id = "service/ecsclustername/servicename"
    19    scalable_dimension = "ecs:service:DesiredCount"
    20  
    21    adjustment_type = "ChangeInCapacity"
    22    cooldown = 60
    23    metric_aggregation_type = "Maximum"
    24  
    25    step_adjustment {
    26      metric_interval_lower_bound = 0
    27      scaling_adjustment = -1
    28    }
    29    depends_on = ["aws_appautoscaling_target.target"]
    30  }
    31  ```
    32  
    33  ## Argument Reference
    34  
    35  The following arguments are supported:
    36  
    37  * `name` - (Required) The name of the policy.
    38  * `policy_type` - (Optional) Defaults to "StepScaling" because it is the only option available.
    39  * `resource_id` - (Required) The Resource ID on which you want the Application AutoScaling policy to apply to. For Amazon ECS services, this value is the resource type, followed by the cluster name and service name, such as `service/default/sample-webapp`.
    40  * `scalable_dimension` - (Optional) The scalable dimension of the scalable target that this scaling policy applies to. The scalable dimension contains the  service  names-     pace,   resource  type,  and  scaling  property,  such  as  `ecs:service:DesiredCount` for the desired task count of an Amazon  ECS  service. Defaults to `ecs:service:DesiredCount` since that is the only allowed value.
    41  * `service_namespace` - (Optional) The AWS service namespace of the scalable target that this scaling policy applies to. Defaults to `ecs`, because that is currently the only supported option.
    42  * `adjustment_type` - (Required) Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.
    43  * `cooldown` - (Required) The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    44  * `metric_aggregation_type` - (Required) The aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    45  * `step_adjustments` - (Optional) A set of adjustments that manage scaling. These have the following structure:
    46  ```
    47  step_adjustment {
    48    scaling_adjustment = -1
    49    metric_interval_lower_bound = 1.0
    50    metric_interval_upper_bound = 2.0
    51  }
    52  step_adjustment {
    53    scaling_adjustment = 1
    54    metric_interval_lower_bound = 2.0
    55    metric_interval_upper_bound = 3.0
    56  }
    57  ```
    58  
    59  * `scaling_adjustment` - (Required) The number of members by which to
    60  scale, when the adjustment bounds are breached. A positive value scales
    61  up. A negative value scales down.
    62  * `metric_interval_lower_bound` - (Optional) The lower bound for the
    63  difference between the alarm threshold and the CloudWatch metric.
    64  Without a value, AWS will treat this bound as infinity.
    65  * `metric_interval_upper_bound` - (Optional) The upper bound for the
    66  difference between the alarm threshold and the CloudWatch metric.
    67  Without a value, AWS will treat this bound as infinity. The upper bound
    68  must be greater than the lower bound.
    69  
    70  ## Attribute Reference
    71  * `arn` - The ARN assigned by AWS to the scaling policy.
    72  * `name` - The scaling policy's name.
    73  * `adjustment_type` - The scaling policy's adjustment type.
    74  * `policy_type` - The scaling policy's type.