AWS Application Auto Scaling Policy
This page shows how to write Terraform and CloudFormation for Application Auto Scaling Policy and write them securely.
aws_appautoscaling_policy (Terraform)
The Policy in Application Auto Scaling can be configured in Terraform with the resource name aws_appautoscaling_policy
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_appautoscaling_policy" "ecs_policy_memory" {
name = "memory-autoscaling"
policy_type = "TargetTrackingScaling"
resource_id = aws_appautoscaling_target.asg_ecs_target.resource_id
scalable_dimension = aws_appautoscaling_target.asg_ecs_target.scalable_dimension
service_namespace = aws_appautoscaling_target.asg_ecs_target.service_namespace
Parameters
-
arn
optional computed - string -
id
optional computed - string -
name
required - string -
policy_type
optional - string -
resource_id
required - string -
scalable_dimension
required - string -
service_namespace
required - string -
step_scaling_policy_configuration
list block-
adjustment_type
optional - string -
cooldown
optional - number -
metric_aggregation_type
optional - string -
min_adjustment_magnitude
optional - number -
step_adjustment
set block-
metric_interval_lower_bound
optional - string -
metric_interval_upper_bound
optional - string -
scaling_adjustment
required - number
-
-
-
target_tracking_scaling_policy_configuration
list block-
disable_scale_in
optional - bool -
scale_in_cooldown
optional - number -
scale_out_cooldown
optional - number -
target_value
required - number -
customized_metric_specification
list block-
metric_name
required - string -
namespace
required - string -
statistic
required - string -
unit
optional - string -
dimensions
set block
-
-
predefined_metric_specification
list block-
predefined_metric_type
required - string -
resource_label
optional - string
-
-
Explanation in Terraform Registry
Provides an Application AutoScaling Policy resource.
AWS::ApplicationAutoScaling::ScalingPolicy (CloudFormation)
The ScalingPolicy in ApplicationAutoScaling can be configured in CloudFormation with the resource name AWS::ApplicationAutoScaling::ScalingPolicy
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
PolicyName
required - String -
PolicyType
required - String -
ResourceId
optional - String -
ScalableDimension
optional - String -
ScalingTargetId
optional - String -
ServiceNamespace
optional - String -
StepScalingPolicyConfiguration
optional - StepScalingPolicyConfiguration -
TargetTrackingScalingPolicyConfiguration
optional - TargetTrackingScalingPolicyConfiguration
Explanation in CloudFormation Registry
The
AWS::ApplicationAutoScaling::ScalingPolicy
resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable target. For more information, see PutScalingPolicy in the Application Auto Scaling API Reference. For more information about Application Auto Scaling scaling policies, see Target tracking scaling policies and Step scaling policies in the Application Auto Scaling User Guide.
Frequently asked questions
What is AWS Application Auto Scaling Policy?
AWS Application Auto Scaling Policy is a resource for Application Auto Scaling of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Application Auto Scaling Policy?
For Terraform, the sorialuise/infra-terraform source code example is useful. See the Terraform Example section for further details.