AWS SDK Version 3 for .NET
API Reference

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.

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.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to RegisterScalableTargetAsync.

Namespace: Amazon.ApplicationAutoScaling
Assembly: AWSSDK.ApplicationAutoScaling.dll
Version: 3.x.y.z

Syntax

C#
public abstract RegisterScalableTargetResponse RegisterScalableTarget(
         RegisterScalableTargetRequest request
)

Parameters

request
Type: Amazon.ApplicationAutoScaling.Model.RegisterScalableTargetRequest

Container for the necessary parameters to execute the RegisterScalableTarget service method.

Return Value


The response from the RegisterScalableTarget service method, as returned by ApplicationAutoScaling.

Exceptions

ExceptionCondition
ConcurrentUpdateException Concurrent updates caused an exception, for example, if you request an update to an Application Auto Scaling resource that already has a pending update.
InternalServiceException The service encountered an internal error.
LimitExceededException A per-account resource limit is exceeded. For more information, see Application Auto Scaling service quotas.
ValidationException An exception was thrown for a validation issue. Review the available parameters for the API request.

Examples

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.

To register an ECS service as a scalable target


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;

            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also