Delete a scaling policy
If you no longer need a scaling policy, you can delete it at any time.
Topics
Delete all scaling policies and deregister the model (console)
To delete all scaling policies and deregister the variant as a scalable target
Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/
. -
On the navigation pane, choose Endpoints.
-
Choose your endpoint, and then for Endpoint runtime settings, choose the variant.
-
Choose Configure auto scaling.
-
Choose Deregister auto scaling.
Delete a scaling policy (AWS CLI or Application Auto Scaling API)
You can use the AWS CLI or the Application Auto Scaling API to delete a scaling policy from a variant.
Delete a scaling policy (AWS CLI)
To delete a scaling policy from a variant, use the delete-scaling-policy command with the following parameters:
-
--policy-name
—The name of the scaling policy. -
--resource-id
—The resource identifier for the variant. For this parameter, the resource type isendpoint
and the unique identifier is the name of the variant. For example,endpoint/
.my-endpoint
/variant/my-variant
-
--service-namespace
—Set this value tosagemaker
. -
--scalable-dimension
—Set this value tosagemaker:variant:DesiredInstanceCount
.
The following example deletes a target tracking scaling policy named
from a
variant named my-scaling-policy
, running on
the my-variant
endpoint.my-endpoint
aws application-autoscaling delete-scaling-policy \ --policy-name
my-scaling-policy
\ --resource-id endpoint/my-endpoint
/variant/my-variant
\ --service-namespace sagemaker \ --scalable-dimension sagemaker:variant:DesiredInstanceCount
Delete a scaling policy (Application Auto Scaling API)
To delete a scaling policy from your variant, use the DeleteScalingPolicy Application Auto Scaling API action with the following parameters:
-
PolicyName
—The name of the scaling policy. -
ServiceNamespace
—Set this value tosagemaker
. -
ResourceID
—The resource identifier for the variant. For this parameter, the resource type isendpoint
and the unique identifier is the name of the variant. For example,endpoint/
.my-endpoint
/variant/my-variant
-
ScalableDimension
—Set this value tosagemaker:variant:DesiredInstanceCount
.
The following example deletes a target tracking scaling policy named
from a
variant named my-scaling-policy
, running on
the my-variant
endpoint.my-endpoint
POST / HTTP/1.1 Host: application-autoscaling.us-east-2.amazonaws.com Accept-Encoding: identity X-Amz-Target: AnyScaleFrontendService.DeleteScalingPolicy X-Amz-Date: 20230506T182145Z User-Agent: aws-cli/2.0.0 Python/3.7.5 Windows/10 botocore/2.0.0dev4 Content-Type: application/x-amz-json-1.1 Authorization: AUTHPARAMS { "PolicyName": "
my-scaling-policy
", "ServiceNamespace": "sagemaker", "ResourceId": "endpoint/my-endpoint
/variant/my-variant
", "ScalableDimension": "sagemaker:variant:DesiredInstanceCount" }