AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the RegisterScalableTarget operation. Registers or updates a scalable target, which is the resource that you want to scale.
Scalable targets are uniquely identified by the combination of resource ID, scalable dimension, and namespace, which represents some capacity dimension of the underlying service.
When you register a new scalable target, you must specify values for the minimum and maximum capacity. If the specified resource is not active in the target service, this operation does not change the resource's current capacity. Otherwise, it changes the resource's current capacity to a value that is inside of this range.
If you add a scaling policy, current capacity is adjustable within the specified range when scaling starts. Application Auto Scaling scaling policies will not scale capacity to values that are outside of the minimum and maximum range.
After you register a scalable target, you do not need to register it again to use other Application Auto Scaling operations. To see which resources have been registered, use DescribeScalableTargets. You can also view the scaling policies for a service namespace by using DescribeScalableTargets. If you no longer need a scalable target, you can deregister it by using DeregisterScalableTarget.
To update a scalable target, specify the parameters that you want to change. Include the parameters that identify the scalable target: resource ID, scalable dimension, and namespace. Any parameters that you don't specify are not changed by this update request.
If you call the RegisterScalableTarget
API operation to create a scalable target,
there might be a brief delay until the operation achieves eventual
consistency. You might become aware of this brief delay if you get unexpected
errors when performing sequential operations. The typical strategy is to retry the
request, and some Amazon Web Services SDKs include automatic backoff and retry logic.
If you call the RegisterScalableTarget
API operation to update an existing
scalable target, Application Auto Scaling retrieves the current capacity of the resource.
If it's below the minimum capacity or above the maximum capacity, Application Auto
Scaling adjusts the capacity of the scalable target to place it within these bounds,
even if you don't include the MinCapacity
or MaxCapacity
request parameters.
Namespace: Amazon.ApplicationAutoScaling.Model
Assembly: AWSSDK.ApplicationAutoScaling.dll
Version: 3.x.y.z
public class RegisterScalableTargetRequest : AmazonApplicationAutoScalingRequest IAmazonWebServiceRequest
The RegisterScalableTargetRequest type exposes the following members
Name | Description | |
---|---|---|
RegisterScalableTargetRequest() |
Name | Type | Description | |
---|---|---|---|
MaxCapacity | System.Int32 |
Gets and sets the property MaxCapacity. The maximum value that you plan to scale out to. When a scaling policy is in effect, Application Auto Scaling can scale out (expand) as needed to the maximum capacity limit in response to changing demand. This property is required when registering a new scalable target. Although you can specify a large maximum capacity, note that service quotas might impose lower limits. Each service has its own default quotas for the maximum capacity of the resource. If you want to specify a higher limit, you can request an increase. For more information, consult the documentation for that service. For information about the default quotas for each service, see Service endpoints and quotas in the Amazon Web Services General Reference. |
|
MinCapacity | System.Int32 |
Gets and sets the property MinCapacity. The minimum value that you plan to scale in to. When a scaling policy is in effect, Application Auto Scaling can scale in (contract) as needed to the minimum capacity limit in response to changing demand. This property is required when registering a new scalable target. For the following resources, the minimum value allowed is 0.
It's strongly recommended that you specify a value greater than 0. A value greater than 0 means that data points are continuously reported to CloudWatch that scaling policies can use to scale on a metric like average CPU utilization. For all other resources, the minimum allowed value depends on the type of resource that you are using. If you provide a value that is lower than what a resource can accept, an error occurs. In which case, the error message will provide the minimum value that the resource can accept. |
|
ResourceId | System.String |
Gets and sets the property ResourceId. The identifier of the resource that is associated with the scalable target. This string consists of the resource type and unique identifier.
|
|
RoleARN | System.String |
Gets and sets the property RoleARN. This parameter is required for services that do not support service-linked roles (such as Amazon EMR), and it must specify the ARN of an IAM role that allows Application Auto Scaling to modify the scalable target on your behalf. If the service supports service-linked roles, Application Auto Scaling uses a service-linked role, which it creates if it does not yet exist. For more information, see Application Auto Scaling IAM roles. |
|
ScalableDimension | Amazon.ApplicationAutoScaling.ScalableDimension |
Gets and sets the property ScalableDimension. The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property.
|
|
ServiceNamespace | Amazon.ApplicationAutoScaling.ServiceNamespace |
Gets and sets the property ServiceNamespace.
The namespace of the Amazon Web Services service that provides the resource. For a
resource provided by your own application or service, use |
|
SuspendedState | Amazon.ApplicationAutoScaling.Model.SuspendedState |
Gets and sets the property SuspendedState.
An embedded object that contains attributes and attribute values that are used to
suspend and resume automatic scaling. Setting the value of an attribute to Suspension Outcomes
For more information, see Suspending and resuming scaling in the Application Auto Scaling User Guide. |
|
Tags | System.Collections.Generic.Dictionary<System.String, System.String> |
Gets and sets the property Tags. Assigns one or more tags to the scalable target. Use this parameter to tag the scalable target when it is created. To tag an existing scalable target, use the TagResource operation. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required. You cannot have more than one tag on a scalable target with the same tag key. Use tags to control access to a scalable target. For more information, see Tagging support for Application Auto Scaling in the Application Auto Scaling User Guide. |
This example registers a scalable target from an Amazon ECS service called web-app that is running on the default cluster, with a minimum desired count of 1 task and a maximum desired count of 10 tasks.
var client = new AmazonApplicationAutoScalingClient(); var response = client.RegisterScalableTarget(new RegisterScalableTargetRequest { MaxCapacity = 10, MinCapacity = 1, ResourceId = "service/default/web-app", ScalableDimension = "ecs:service:DesiredCount", ServiceNamespace = "ecs" }); string scalableTargetARN = response.ScalableTargetARN;
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5