Use DescribeScalableTargets with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DescribeScalableTargets with a CLI

The following code examples show how to use DescribeScalableTargets.

CLI
AWS CLI

To describe scalable targets

The following describe-scalable-targets example describes the scalable targets for the ecs service namespace.

aws application-autoscaling describe-scalable-targets \ --service-namespace ecs

Output:

{ "ScalableTargets": [ { "ServiceNamespace": "ecs", "ScalableDimension": "ecs:service:DesiredCount", "ResourceId": "service/default/web-app", "MinCapacity": 1, "MaxCapacity": 10, "RoleARN": "arn:aws:iam::123456789012:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService", "CreationTime": 1462558906.199, "SuspendedState": { "DynamicScalingOutSuspended": false, "ScheduledScalingSuspended": false, "DynamicScalingInSuspended": false }, "ScalableTargetARN": "arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123" } ] }

For more information, see AWS services that you can use with Application Auto Scaling in the Application Auto Scaling User Guide.

PowerShell
Tools for PowerShell

Example 1: This example will provide information about the Application Autoscaling Scalable targets in the specified namespace.

Get-AASScalableTarget -ServiceNamespace "AppStream"

Output:

CreationTime : 11/7/2019 2:30:03 AM MaxCapacity : 5 MinCapacity : 1 ResourceId : fleet/Test RoleARN : arn:aws:iam::012345678912:role/aws-service-role/appstream.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_AppStreamFleet ScalableDimension : appstream:fleet:DesiredCapacity ServiceNamespace : appstream SuspendedState : Amazon.ApplicationAutoScaling.Model.SuspendedState