- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DescribeScalableTargetsCommand
Gets information about the scalable targets in the specified namespace.
You can filter the results using ResourceIds
and ScalableDimension
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ApplicationAutoScalingClient, DescribeScalableTargetsCommand } from "@aws-sdk/client-application-auto-scaling"; // ES Modules import
// const { ApplicationAutoScalingClient, DescribeScalableTargetsCommand } = require("@aws-sdk/client-application-auto-scaling"); // CommonJS import
const client = new ApplicationAutoScalingClient(config);
const input = { // DescribeScalableTargetsRequest
ServiceNamespace: "ecs" || "elasticmapreduce" || "ec2" || "appstream" || "dynamodb" || "rds" || "sagemaker" || "custom-resource" || "comprehend" || "lambda" || "cassandra" || "kafka" || "elasticache" || "neptune" || "workspaces", // required
ResourceIds: [ // ResourceIdsMaxLen1600
"STRING_VALUE",
],
ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:cache-cluster:Nodes" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions",
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new DescribeScalableTargetsCommand(input);
const response = await client.send(command);
// { // DescribeScalableTargetsResponse
// ScalableTargets: [ // ScalableTargets
// { // ScalableTarget
// ServiceNamespace: "ecs" || "elasticmapreduce" || "ec2" || "appstream" || "dynamodb" || "rds" || "sagemaker" || "custom-resource" || "comprehend" || "lambda" || "cassandra" || "kafka" || "elasticache" || "neptune" || "workspaces", // required
// ResourceId: "STRING_VALUE", // required
// ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:cache-cluster:Nodes" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions", // required
// MinCapacity: Number("int"), // required
// MaxCapacity: Number("int"), // required
// PredictedCapacity: Number("int"),
// RoleARN: "STRING_VALUE", // required
// CreationTime: new Date("TIMESTAMP"), // required
// SuspendedState: { // SuspendedState
// DynamicScalingInSuspended: true || false,
// DynamicScalingOutSuspended: true || false,
// ScheduledScalingSuspended: true || false,
// },
// ScalableTargetARN: "STRING_VALUE",
// },
// ],
// NextToken: "STRING_VALUE",
// };
Example Usage
DescribeScalableTargetsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ServiceNamespace Required | ServiceNamespace | undefined | The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use |
MaxResults | number | undefined | The maximum number of scalable targets. This value can be between 1 and 50. The default value is 50. If this parameter is used, the operation returns up to |
NextToken | string | undefined | The token for the next set of results. |
ResourceIds | string[] | undefined | The identifier of the resource associated with the scalable target. This string consists of the resource type and unique identifier.
|
ScalableDimension | ScalableDimension | undefined | The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property. If you specify a scalable dimension, you must also specify a resource ID.
|
DescribeScalableTargetsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
NextToken | string | undefined | The token required to get the next set of results. This value is |
ScalableTargets | ScalableTarget[] | undefined | The scalable targets that match the request parameters. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ConcurrentUpdateException | server | 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 | server | The service encountered an internal error. |
InvalidNextTokenException | client | The next token supplied was invalid. |
ValidationException | client | An exception was thrown for a validation issue. Review the available parameters for the API request. |
ApplicationAutoScalingServiceException | Base exception class for all service exceptions from ApplicationAutoScaling service. |