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. A scalable target is a resource that Application Auto Scaling can scale out or scale in. After you have registered a scalable target, you can use this operation to update the minimum and maximum values for your scalable dimension.

After you register a scalable target, you can create and apply scaling policies using PutScalingPolicy. You can view the scaling policies for a service namespace using DescribeScalableTargets. If you are no longer using a scalable target, you can deregister it using DeregisterScalableTarget.

Note:

For PCL 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 virtual 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 Your account exceeded a limit. This exception is thrown when a per-account resource limit is exceeded. For more information, see Application Auto Scaling Limits.
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 response = client.RegisterScalableTarget(new RegisterScalableTargetRequest 
{
    MaxCapacity = 10,
    MinCapacity = 1,
    ResourceId = "service/default/web-app",
    RoleARN = "arn:aws:iam::012345678910:role/ApplicationAutoscalingECSRole",
    ScalableDimension = "ecs:service:DesiredCount",
    ServiceNamespace = "ecs"
});


            

This example registers a scalable target from an Amazon EC2 Spot fleet with a minimum target capacity of 1 and a maximum of 10.

To register an EC2 Spot fleet as a scalable target


var response = client.RegisterScalableTarget(new RegisterScalableTargetRequest 
{
    MaxCapacity = 10,
    MinCapacity = 1,
    ResourceId = "spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3",
    RoleARN = "arn:aws:iam::012345678910:role/ApplicationAutoscalingSpotRole",
    ScalableDimension = "ec2:spot-fleet-request:TargetCapacity",
    ServiceNamespace = "ec2"
});


            

Version Information

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

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also