AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

StepScalingPolicyConfiguration

import "github.com/aws/aws-sdk-go/service/applicationautoscaling"

type StepScalingPolicyConfiguration struct { AdjustmentType *string `type:"string" enum:"AdjustmentType"` Cooldown *int64 `type:"integer"` MetricAggregationType *string `type:"string" enum:"MetricAggregationType"` MinAdjustmentMagnitude *int64 `type:"integer"` StepAdjustments []*StepAdjustment `type:"list"` }

Represents a step scaling policy configuration to use with Application Auto Scaling.

AdjustmentType

Type: *string

The adjustment type, which specifies how the ScalingAdjustment parameter in a StepAdjustment is interpreted.

Cooldown

Type: *int64

The amount of time, in seconds, after a scaling activity completes where previous trigger-related scaling activities can influence future scaling events.

For scale-out policies, while the cooldown period is in effect, the capacity that has been added by the previous scale-out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. The intention is to continuously (but not excessively) scale out. For example, an alarm triggers a step scaling policy to scale out an Amazon ECS service by 2 tasks, the scaling activity completes successfully, and a cooldown period of 5 minutes starts. During the cooldown period, if the alarm triggers the same policy again but at a more aggressive step adjustment to scale out the service by 3 tasks, the 2 tasks that were added in the previous scale-out event are considered part of that capacity and only 1 additional task is added to the desired count.

For scale-in policies, the cooldown period is used to block subsequent scale-in requests until it has expired. The intention is to scale in conservatively to protect your application's availability. However, if another alarm triggers a scale-out policy during the cooldown period after a scale-in, Application Auto Scaling scales out your scalable target immediately.

MetricAggregationType

Type: *string

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

MinAdjustmentMagnitude

Type: *int64

The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.

For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Application Auto Scaling scales out the service by 2 tasks.

StepAdjustments

Represents a step adjustment for a StepScalingPolicyConfiguration. Describes an adjustment based on the difference between the value of the aggregated CloudWatch metric and the breach threshold that you've defined for the alarm.

For the following examples, suppose that you have an alarm with a breach threshold of 50:

  • To trigger the adjustment when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10.

  • To trigger the adjustment when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0.

There are a few rules for the step adjustments for your step policy:

  • The ranges of your step adjustments can't overlap or have a gap.

  • At most one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound.

  • At most one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound.

  • The upper and lower bound can't be null in the same step adjustment.

Method

GoString

func (s StepScalingPolicyConfiguration) GoString() string

GoString returns the string representation

SetAdjustmentType

func (s *StepScalingPolicyConfiguration) SetAdjustmentType(v string) *StepScalingPolicyConfiguration

SetAdjustmentType sets the AdjustmentType field's value.

SetCooldown

func (s *StepScalingPolicyConfiguration) SetCooldown(v int64) *StepScalingPolicyConfiguration

SetCooldown sets the Cooldown field's value.

SetMetricAggregationType

func (s *StepScalingPolicyConfiguration) SetMetricAggregationType(v string) *StepScalingPolicyConfiguration

SetMetricAggregationType sets the MetricAggregationType field's value.

SetMinAdjustmentMagnitude

func (s *StepScalingPolicyConfiguration) SetMinAdjustmentMagnitude(v int64) *StepScalingPolicyConfiguration

SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value.

SetStepAdjustments

func (s *StepScalingPolicyConfiguration) SetStepAdjustments(v []*StepAdjustment) *StepScalingPolicyConfiguration

SetStepAdjustments sets the StepAdjustments field's value.

String

func (s StepScalingPolicyConfiguration) String() string

String returns the string representation

Validate

func (s *StepScalingPolicyConfiguration) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: