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.

PutScalingPolicyInput

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

type PutScalingPolicyInput struct { AdjustmentType *string `min:"1" type:"string"` AutoScalingGroupName *string `min:"1" type:"string" required:"true"` Cooldown *int64 `type:"integer"` EstimatedInstanceWarmup *int64 `type:"integer"` MetricAggregationType *string `min:"1" type:"string"` MinAdjustmentMagnitude *int64 `type:"integer"` MinAdjustmentStep *int64 `deprecated:"true" type:"integer"` PolicyName *string `min:"1" type:"string" required:"true"` PolicyType *string `min:"1" type:"string"` ScalingAdjustment *int64 `type:"integer"` StepAdjustments []*StepAdjustment `type:"list"` TargetTrackingConfiguration *TargetTrackingConfiguration `type:"structure"` }

AdjustmentType

Type: *string

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 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) in the Amazon EC2 Auto Scaling User Guide.

AutoScalingGroupName

Type: *string

The name of the Auto Scaling group.

AutoScalingGroupName is a required field

Cooldown

Type: *int64

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 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) in the Amazon EC2 Auto Scaling User Guide.

EstimatedInstanceWarmup

Type: *int64

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.

MetricAggregationType

Type: *string

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.

MinAdjustmentMagnitude

Type: *int64

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.

MinAdjustmentStep

Type: *int64

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

PolicyName

Type: *string

The name of the policy.

PolicyName is a required field

PolicyType

Type: *string

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

ScalingAdjustment

Type: *int64

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.

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

StepAdjustments

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.

TargetTrackingConfiguration

Represents a target tracking policy configuration to use with Amazon EC2 Auto Scaling.

Method

GoString

func (s PutScalingPolicyInput) GoString() string

GoString returns the string representation

SetAdjustmentType

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

SetAdjustmentType sets the AdjustmentType field's value.

SetAutoScalingGroupName

func (s *PutScalingPolicyInput) SetAutoScalingGroupName(v string) *PutScalingPolicyInput

SetAutoScalingGroupName sets the AutoScalingGroupName field's value.

SetCooldown

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

SetCooldown sets the Cooldown field's value.

SetEstimatedInstanceWarmup

func (s *PutScalingPolicyInput) SetEstimatedInstanceWarmup(v int64) *PutScalingPolicyInput

SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value.

SetMetricAggregationType

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

SetMetricAggregationType sets the MetricAggregationType field's value.

SetMinAdjustmentMagnitude

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

SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value.

SetMinAdjustmentStep

func (s *PutScalingPolicyInput) SetMinAdjustmentStep(v int64) *PutScalingPolicyInput

SetMinAdjustmentStep sets the MinAdjustmentStep field's value.

SetPolicyName

func (s *PutScalingPolicyInput) SetPolicyName(v string) *PutScalingPolicyInput

SetPolicyName sets the PolicyName field's value.

SetPolicyType

func (s *PutScalingPolicyInput) SetPolicyType(v string) *PutScalingPolicyInput

SetPolicyType sets the PolicyType field's value.

SetScalingAdjustment

func (s *PutScalingPolicyInput) SetScalingAdjustment(v int64) *PutScalingPolicyInput

SetScalingAdjustment sets the ScalingAdjustment field's value.

SetStepAdjustments

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

SetStepAdjustments sets the StepAdjustments field's value.

SetTargetTrackingConfiguration

func (s *PutScalingPolicyInput) SetTargetTrackingConfiguration(v *TargetTrackingConfiguration) *PutScalingPolicyInput

SetTargetTrackingConfiguration sets the TargetTrackingConfiguration field's value.

String

func (s PutScalingPolicyInput) String() string

String returns the string representation

Validate

func (s *PutScalingPolicyInput) Validate() error

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

On this page: