amazonka-application-autoscaling-1.6.0: Amazon Application 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.ApplicationAutoScaling.PutScalingPolicy

Contents

Description

Creates or updates a policy for an Application Auto Scaling scalable target.

Each scalable target is identified by a service namespace, resource ID, and scalable dimension. A scaling policy applies to the scalable target identified by those three attributes. You cannot create a scaling policy until you register the scalable target using RegisterScalableTarget .

To update a policy, specify its policy name and the parameters that you want to change. Any parameters that you don't specify are not changed by this update request.

You can view the scaling policies for a service namespace using DescribeScalingPolicies . If you are no longer using a scaling policy, you can delete it using DeleteScalingPolicy .

Synopsis

Creating a Request

putScalingPolicy #

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:

  • pspPolicyType - The policy type. This parameter is required if you are creating a policy. For DynamoDB, only TargetTrackingScaling is supported. For Amazon ECS, Spot Fleet, and Amazon RDS, both StepScaling and TargetTrackingScaling are supported. For any other service, only StepScaling is supported.
  • pspTargetTrackingScalingPolicyConfiguration - A target tracking policy. This parameter is required if you are creating a policy and the policy type is TargetTrackingScaling .
  • pspStepScalingPolicyConfiguration - A step scaling policy. This parameter is required if you are creating a policy and the policy type is StepScaling .
  • pspPolicyName - The name of the scaling policy.
  • pspServiceNamespace - The namespace of the AWS service. For more information, see AWS Service Namespaces in the Amazon Web Services General Reference .
  • pspResourceId - The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier. * ECS service - The resource type is service and the unique identifier is the cluster name and service name. Example: servicedefaultsample-webapp . * Spot fleet request - The resource type is spot-fleet-request and the unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE . * EMR cluster - The resource type is instancegroup and the unique identifier is the cluster ID and instance group ID. Example: instancegroupj-2EEZNYKUA1NTVig-1791Y4E1L8YI0 . * AppStream 2.0 fleet - The resource type is fleet and the unique identifier is the fleet name. Example: fleet/sample-fleet . * DynamoDB table - The resource type is table and the unique identifier is the resource ID. Example: table/my-table . * DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. Example: tablemy-tableindex/my-table-index . * Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. Example: cluster:my-db-cluster . * Amazon SageMaker endpoint variants - The resource type is variant and the unique identifier is the resource ID. Example: endpointmy-end-pointvariant/KMeansClustering .
  • pspScalableDimension - The scalable dimension. This string consists of the service namespace, resource type, and scaling property. * ecs:service:DesiredCount - The desired task count of an ECS service. * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot fleet request. * elasticmapreduce:instancegroup:InstanceCount - The instance count of an EMR Instance Group. * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream 2.0 fleet. * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table. * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table. * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index. * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index. * rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition. * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances for an Amazon SageMaker model endpoint variant.

data PutScalingPolicy #

See: putScalingPolicy smart constructor.

Instances
Eq PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Data PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

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 # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Show PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Generic PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Associated Types

type Rep PutScalingPolicy :: * -> * #

Hashable PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

ToJSON PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

AWSRequest PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Associated Types

type Rs PutScalingPolicy :: * #

ToHeaders PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

ToPath PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

ToQuery PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

NFData PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Methods

rnf :: PutScalingPolicy -> () #

type Rep PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

type Rep PutScalingPolicy = D1 (MetaData "PutScalingPolicy" "Network.AWS.ApplicationAutoScaling.PutScalingPolicy" "amazonka-application-autoscaling-1.6.0-AidKHHtB25wGBlWufdpEhn" False) (C1 (MetaCons "PutScalingPolicy'" PrefixI True) ((S1 (MetaSel (Just "_pspPolicyType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe PolicyType)) :*: (S1 (MetaSel (Just "_pspTargetTrackingScalingPolicyConfiguration") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe TargetTrackingScalingPolicyConfiguration)) :*: S1 (MetaSel (Just "_pspStepScalingPolicyConfiguration") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe StepScalingPolicyConfiguration)))) :*: ((S1 (MetaSel (Just "_pspPolicyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_pspServiceNamespace") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ServiceNamespace)) :*: (S1 (MetaSel (Just "_pspResourceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_pspScalableDimension") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ScalableDimension)))))
type Rs PutScalingPolicy # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Request Lenses

pspPolicyType :: Lens' PutScalingPolicy (Maybe PolicyType) #

The policy type. This parameter is required if you are creating a policy. For DynamoDB, only TargetTrackingScaling is supported. For Amazon ECS, Spot Fleet, and Amazon RDS, both StepScaling and TargetTrackingScaling are supported. For any other service, only StepScaling is supported.

pspTargetTrackingScalingPolicyConfiguration :: Lens' PutScalingPolicy (Maybe TargetTrackingScalingPolicyConfiguration) #

A target tracking policy. This parameter is required if you are creating a policy and the policy type is TargetTrackingScaling .

pspStepScalingPolicyConfiguration :: Lens' PutScalingPolicy (Maybe StepScalingPolicyConfiguration) #

A step scaling policy. This parameter is required if you are creating a policy and the policy type is StepScaling .

pspPolicyName :: Lens' PutScalingPolicy Text #

The name of the scaling policy.

pspServiceNamespace :: Lens' PutScalingPolicy ServiceNamespace #

The namespace of the AWS service. For more information, see AWS Service Namespaces in the Amazon Web Services General Reference .

pspResourceId :: Lens' PutScalingPolicy Text #

The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier. * ECS service - The resource type is service and the unique identifier is the cluster name and service name. Example: servicedefaultsample-webapp . * Spot fleet request - The resource type is spot-fleet-request and the unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE . * EMR cluster - The resource type is instancegroup and the unique identifier is the cluster ID and instance group ID. Example: instancegroupj-2EEZNYKUA1NTVig-1791Y4E1L8YI0 . * AppStream 2.0 fleet - The resource type is fleet and the unique identifier is the fleet name. Example: fleet/sample-fleet . * DynamoDB table - The resource type is table and the unique identifier is the resource ID. Example: table/my-table . * DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. Example: tablemy-tableindex/my-table-index . * Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. Example: cluster:my-db-cluster . * Amazon SageMaker endpoint variants - The resource type is variant and the unique identifier is the resource ID. Example: endpointmy-end-pointvariant/KMeansClustering .

pspScalableDimension :: Lens' PutScalingPolicy ScalableDimension #

The scalable dimension. This string consists of the service namespace, resource type, and scaling property. * ecs:service:DesiredCount - The desired task count of an ECS service. * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot fleet request. * elasticmapreduce:instancegroup:InstanceCount - The instance count of an EMR Instance Group. * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream 2.0 fleet. * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table. * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table. * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index. * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index. * rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition. * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances for an Amazon SageMaker model endpoint variant.

Destructuring the Response

putScalingPolicyResponse #

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 #

See: putScalingPolicyResponse smart constructor.

Instances
Eq PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Data PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

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 # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Show PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Generic PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

Associated Types

type Rep PutScalingPolicyResponse :: * -> * #

NFData PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

type Rep PutScalingPolicyResponse # 
Instance details

Defined in Network.AWS.ApplicationAutoScaling.PutScalingPolicy

type Rep PutScalingPolicyResponse = D1 (MetaData "PutScalingPolicyResponse" "Network.AWS.ApplicationAutoScaling.PutScalingPolicy" "amazonka-application-autoscaling-1.6.0-AidKHHtB25wGBlWufdpEhn" False) (C1 (MetaCons "PutScalingPolicyResponse'" PrefixI True) (S1 (MetaSel (Just "_psprsAlarms") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Alarm])) :*: (S1 (MetaSel (Just "_psprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "_psprsPolicyARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))

Response Lenses

psprsAlarms :: Lens' PutScalingPolicyResponse [Alarm] #

The CloudWatch alarms created for the target tracking policy.

psprsResponseStatus :: Lens' PutScalingPolicyResponse Int #

  • - | The response status code.

psprsPolicyARN :: Lens' PutScalingPolicyResponse Text #

The Amazon Resource Name (ARN) of the resulting scaling policy.