amazonka-autoscaling-1.6.0: Amazon Auto Scaling SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.AutoScaling.PutScalingPolicy

Contents

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 you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .

Synopsis

Creating a Request

putScalingPolicy Source #

Creates a value of PutScalingPolicy with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • pspMinAdjustmentStep - Available for backward compatibility. Use MinAdjustmentMagnitude instead.
  • pspEstimatedInstanceWarmup - 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 .
  • pspPolicyType - The policy type. The valid values are SimpleScaling , StepScaling , and TargetTrackingScaling . If the policy type is null, the value is treated as SimpleScaling .
  • pspStepAdjustments - A set of adjustments that enable you to scale based on the size of the alarm breach. This parameter is required if the policy type is StepScaling and not supported otherwise.
  • pspTargetTrackingConfiguration - A target tracking policy. This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.
  • pspAdjustmentType - 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 Auto Scaling User Guide .
  • pspScalingAdjustment - 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.
  • pspCooldown - 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 Auto Scaling Cooldowns in the Auto Scaling User Guide .
  • pspMetricAggregationType - 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 .
  • pspMinAdjustmentMagnitude - 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 .
  • pspAutoScalingGroupName - The name of the Auto Scaling group.
  • pspPolicyName - The name of the policy.

data PutScalingPolicy Source #

See: putScalingPolicy smart constructor.

Instances

Eq PutScalingPolicy Source # 
Data PutScalingPolicy Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutScalingPolicy -> c PutScalingPolicy #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutScalingPolicy #

toConstr :: PutScalingPolicy -> Constr #

dataTypeOf :: PutScalingPolicy -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutScalingPolicy) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutScalingPolicy) #

gmapT :: (forall b. Data b => b -> b) -> PutScalingPolicy -> PutScalingPolicy #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicy -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicy -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutScalingPolicy -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutScalingPolicy -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

Read PutScalingPolicy Source # 
Show PutScalingPolicy Source # 
Generic PutScalingPolicy Source # 
Hashable PutScalingPolicy Source # 
NFData PutScalingPolicy Source # 

Methods

rnf :: PutScalingPolicy -> () #

AWSRequest PutScalingPolicy Source # 
ToHeaders PutScalingPolicy Source # 
ToPath PutScalingPolicy Source # 
ToQuery PutScalingPolicy Source # 
type Rep PutScalingPolicy Source # 
type Rep PutScalingPolicy = D1 * (MetaData "PutScalingPolicy" "Network.AWS.AutoScaling.PutScalingPolicy" "amazonka-autoscaling-1.6.0-Cbg5YTxJJyv60SSUTcTsy3" False) (C1 * (MetaCons "PutScalingPolicy'" PrefixI True) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_pspMinAdjustmentStep") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspEstimatedInstanceWarmup") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) (S1 * (MetaSel (Just Symbol "_pspPolicyType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspStepAdjustments") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [StepAdjustment]))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspTargetTrackingConfiguration") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe TargetTrackingConfiguration))) (S1 * (MetaSel (Just Symbol "_pspAdjustmentType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text)))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_pspScalingAdjustment") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspCooldown") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) (S1 * (MetaSel (Just Symbol "_pspMetricAggregationType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspMinAdjustmentMagnitude") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "_pspAutoScalingGroupName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "_pspPolicyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)))))))
type Rs PutScalingPolicy Source # 

Request Lenses

pspMinAdjustmentStep :: Lens' PutScalingPolicy (Maybe Int) Source #

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

pspEstimatedInstanceWarmup :: Lens' PutScalingPolicy (Maybe Int) Source #

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 .

pspPolicyType :: Lens' PutScalingPolicy (Maybe Text) Source #

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

pspStepAdjustments :: Lens' PutScalingPolicy [StepAdjustment] Source #

A set of adjustments that enable you to scale based on the size of the alarm breach. This parameter is required if the policy type is StepScaling and not supported otherwise.

pspTargetTrackingConfiguration :: Lens' PutScalingPolicy (Maybe TargetTrackingConfiguration) Source #

A target tracking policy. This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.

pspAdjustmentType :: Lens' PutScalingPolicy (Maybe Text) Source #

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 Auto Scaling User Guide .

pspScalingAdjustment :: Lens' PutScalingPolicy (Maybe Int) Source #

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.

pspCooldown :: Lens' PutScalingPolicy (Maybe Int) Source #

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 Auto Scaling Cooldowns in the Auto Scaling User Guide .

pspMetricAggregationType :: Lens' PutScalingPolicy (Maybe Text) Source #

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 .

pspMinAdjustmentMagnitude :: Lens' PutScalingPolicy (Maybe Int) Source #

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 .

pspAutoScalingGroupName :: Lens' PutScalingPolicy Text Source #

The name of the Auto Scaling group.

pspPolicyName :: Lens' PutScalingPolicy Text Source #

The name of the policy.

Destructuring the Response

putScalingPolicyResponse Source #

Creates a value of PutScalingPolicyResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data PutScalingPolicyResponse Source #

Contains the output of PutScalingPolicy.

See: putScalingPolicyResponse smart constructor.

Instances

Eq PutScalingPolicyResponse Source # 
Data PutScalingPolicyResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutScalingPolicyResponse -> c PutScalingPolicyResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutScalingPolicyResponse #

toConstr :: PutScalingPolicyResponse -> Constr #

dataTypeOf :: PutScalingPolicyResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutScalingPolicyResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutScalingPolicyResponse) #

gmapT :: (forall b. Data b => b -> b) -> PutScalingPolicyResponse -> PutScalingPolicyResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicyResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicyResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutScalingPolicyResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutScalingPolicyResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

Read PutScalingPolicyResponse Source # 
Show PutScalingPolicyResponse Source # 
Generic PutScalingPolicyResponse Source # 
NFData PutScalingPolicyResponse Source # 
type Rep PutScalingPolicyResponse Source # 
type Rep PutScalingPolicyResponse = D1 * (MetaData "PutScalingPolicyResponse" "Network.AWS.AutoScaling.PutScalingPolicy" "amazonka-autoscaling-1.6.0-Cbg5YTxJJyv60SSUTcTsy3" False) (C1 * (MetaCons "PutScalingPolicyResponse'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_psprsPolicyARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_psprsAlarms") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [Alarm]))) (S1 * (MetaSel (Just Symbol "_psprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)))))

Response Lenses

psprsPolicyARN :: Lens' PutScalingPolicyResponse (Maybe Text) Source #

The Amazon Resource Name (ARN) of the policy.

psprsAlarms :: Lens' PutScalingPolicyResponse [Alarm] Source #

The CloudWatch alarms created for the target tracking policy.