paws.management (version 0.1.0)

autoscaling_put_scaling_policy: Creates or updates a policy for an Auto Scaling group

Description

Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

Usage

autoscaling_put_scaling_policy(AutoScalingGroupName, PolicyName,
  PolicyType, AdjustmentType, MinAdjustmentStep, MinAdjustmentMagnitude,
  ScalingAdjustment, Cooldown, MetricAggregationType, StepAdjustments,
  EstimatedInstanceWarmup, TargetTrackingConfiguration)

Arguments

AutoScalingGroupName

[required] The name of the Auto Scaling group.

PolicyName

[required] The name of the policy.

PolicyType

The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. If the policy type is null, the value is treated as SimpleScaling.

AdjustmentType

The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

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

MinAdjustmentStep

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

MinAdjustmentMagnitude

The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

ScalingAdjustment

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.

Conditional: This parameter is required if the policy type is SimpleScaling and not supported otherwise.

Cooldown

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. If this parameter is not specified, the default cooldown period for the group applies.

This parameter is supported if the policy type is SimpleScaling.

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

MetricAggregationType

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average.

This parameter is supported if the policy type is StepScaling.

StepAdjustments

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

Conditional: This parameter is required if the policy type is StepScaling and not supported otherwise.

EstimatedInstanceWarmup

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. The default is to use the value specified for the default cooldown period for the group.

This parameter is supported if the policy type is StepScaling or TargetTrackingScaling.

TargetTrackingConfiguration

A target tracking scaling policy. Includes support for predefined or customized metrics.

Conditional: This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.

Request syntax

svc$put_scaling_policy(
  AutoScalingGroupName = "string",
  PolicyName = "string",
  PolicyType = "string",
  AdjustmentType = "string",
  MinAdjustmentStep = 123,
  MinAdjustmentMagnitude = 123,
  ScalingAdjustment = 123,
  Cooldown = 123,
  MetricAggregationType = "string",
  StepAdjustments = list(
    list(
      MetricIntervalLowerBound = 123.0,
      MetricIntervalUpperBound = 123.0,
      ScalingAdjustment = 123
    )
  ),
  EstimatedInstanceWarmup = 123,
  TargetTrackingConfiguration = list(
    PredefinedMetricSpecification = list(
      PredefinedMetricType = "ASGAverageCPUUtilization"|"ASGAverageNetworkIn"|"ASGAverageNetworkOut"|"ALBRequestCountPerTarget",
      ResourceLabel = "string"
    ),
    CustomizedMetricSpecification = list(
      MetricName = "string",
      Namespace = "string",
      Dimensions = list(
        list(
          Name = "string",
          Value = "string"
        )
      ),
      Statistic = "Average"|"Minimum"|"Maximum"|"SampleCount"|"Sum",
      Unit = "string"
    ),
    TargetValue = 123.0,
    DisableScaleIn = TRUE|FALSE
  )
)

Examples

Run this code
# NOT RUN {
# This example adds the specified policy to the specified Auto Scaling
# group.
# }
# NOT RUN {
svc$put_scaling_policy(
  AdjustmentType = "ChangeInCapacity",
  AutoScalingGroupName = "my-auto-scaling-group",
  PolicyName = "ScaleIn",
  ScalingAdjustment = -1L
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace