Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 .
- putScalingPolicy :: Text -> Text -> PutScalingPolicy
- data PutScalingPolicy
- pspMinAdjustmentStep :: Lens' PutScalingPolicy (Maybe Int)
- pspEstimatedInstanceWarmup :: Lens' PutScalingPolicy (Maybe Int)
- pspPolicyType :: Lens' PutScalingPolicy (Maybe Text)
- pspStepAdjustments :: Lens' PutScalingPolicy [StepAdjustment]
- pspTargetTrackingConfiguration :: Lens' PutScalingPolicy (Maybe TargetTrackingConfiguration)
- pspAdjustmentType :: Lens' PutScalingPolicy (Maybe Text)
- pspScalingAdjustment :: Lens' PutScalingPolicy (Maybe Int)
- pspCooldown :: Lens' PutScalingPolicy (Maybe Int)
- pspMetricAggregationType :: Lens' PutScalingPolicy (Maybe Text)
- pspMinAdjustmentMagnitude :: Lens' PutScalingPolicy (Maybe Int)
- pspAutoScalingGroupName :: Lens' PutScalingPolicy Text
- pspPolicyName :: Lens' PutScalingPolicy Text
- putScalingPolicyResponse :: Int -> PutScalingPolicyResponse
- data PutScalingPolicyResponse
- psprsPolicyARN :: Lens' PutScalingPolicyResponse (Maybe Text)
- psprsAlarms :: Lens' PutScalingPolicyResponse [Alarm]
- psprsResponseStatus :: Lens' PutScalingPolicyResponse Int
Creating a Request
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. UseMinAdjustmentMagnitude
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 isStepScaling
orTargetTrackingScaling
.pspPolicyType
- The policy type. The valid values areSimpleScaling
,StepScaling
, andTargetTrackingScaling
. If the policy type is null, the value is treated asSimpleScaling
.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 isStepScaling
and not supported otherwise.pspTargetTrackingConfiguration
- A target tracking policy. This parameter is required if the policy type isTargetTrackingScaling
and not supported otherwise.pspAdjustmentType
- The adjustment type. The valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
. This parameter is supported if the policy type isSimpleScaling
orStepScaling
. 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 isSimpleScaling
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 isSimpleScaling
. For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide .pspMetricAggregationType
- The aggregation type for the CloudWatch metrics. The valid values areMinimum
,Maximum
, andAverage
. If the aggregation type is null, the value is treated asAverage
. This parameter is supported if the policy type isStepScaling
.pspMinAdjustmentMagnitude
- The minimum number of instances to scale. If the value ofAdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
. This parameter is supported if the policy type isSimpleScaling
orStepScaling
.pspAutoScalingGroupName
- The name or ARN of the group.pspPolicyName
- The name of the policy.
data PutScalingPolicy Source #
See: putScalingPolicy
smart constructor.
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 or ARN of the 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:
psprsPolicyARN
- The Amazon Resource Name (ARN) of the policy.psprsAlarms
- The CloudWatch alarms created for the target tracking policy.psprsResponseStatus
- -- | The response status code.
data PutScalingPolicyResponse Source #
Contains the output of PutScalingPolicy.
See: putScalingPolicyResponse
smart constructor.
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.
psprsResponseStatus :: Lens' PutScalingPolicyResponse Int Source #
- - | The response status code.