AWS CLI를 사용하는 Application Auto Scaling 예제 - AWS Command Line Interface

AWS CLI를 사용하는 Application Auto Scaling 예제

다음 코드 예제에서는 Application Auto Scaling과 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예제에는 컨텍스트에서 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있는 전체 소스 코드에 대한 링크가 포함되어 있습니다.

주제

작업

다음 코드 예시에서는 delete-scaling-policy을 사용하는 방법을 보여 줍니다.

AWS CLI

조정 정책을 삭제하는 방법

이 예제에서는 기본 클러스터에서 실행되는 Amazon ECS 서비스 웹앱에 대한 조정 정책을 삭제합니다.

명령:

aws application-autoscaling delete-scaling-policy --policy-name web-app-cpu-lt-25 --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app --service-namespace ecs

다음 코드 예시에서는 delete-scheduled-action을 사용하는 방법을 보여 줍니다.

AWS CLI

예약된 작업 삭제

다음 delete-scheduled-action 예제에서는 지정된 Amazon AppStream 2.0 플릿에서 지정된 예약된 작업을 삭제합니다.

aws application-autoscaling delete-scheduled-action \ --service-namespace appstream \ --scalable-dimension appstream:fleet:DesiredCapacity \ --resource-id fleet/sample-fleet \ --scheduled-action-name my-recurring-action

이 명령은 출력을 생성하지 않습니다.

자세한 내용은 https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.htmlApplication Auto Scaling 사용 설명서의 예약된 조정을 참조하세요.

다음 코드 예시에서는 deregister-scalable-target을 사용하는 방법을 보여 줍니다.

AWS CLI

확장 가능 대상의 등록을 취소하는 방법

이 예제에서는 기본 클러스터에서 실행 중인 웹앱이라고 하는 Amazon ECS 서비스에 대한 확장 가능 대상의 등록을 취소합니다.

명령:

aws application-autoscaling deregister-scalable-target --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app

이 예제에서는 사용자 지정 리소스에 대한 확장 가능 대상의 등록을 취소합니다. custom-resource-id.txt 파일에는 리소스 ID를 식별하는 문자열이 포함되어 있으며 이는 사용자 지정 리소스의 경우 Amazon API Gateway 엔드포인트를 통하는 사용자 지정 리소스에 대한 경로입니다.

명령:

aws application-autoscaling deregister-scalable-target --service-namespace custom-resource --scalable-dimension custom-resource:ResourceType:Property --resource-id file://~/custom-resource-id.txt

custom-resource-id.txt 파일의 콘텐츠:

https://example.execute-api.us-west-2.amazonaws.com/prod/scalableTargetDimensions/1-23456789

다음 코드 예시에서는 describe-scalable-targets을 사용하는 방법을 보여 줍니다.

AWS CLI

확장 가능 대상을 설명하는 방법

다음 describe-scalable-targets 예제에서는 ecs 서비스 네임스페이스에 대한 확장 가능 대상을 설명합니다.

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

출력:

{ "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" } ] }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling과 함께 사용할 수 있는 AWS 서비스를 참조하세요.

다음 코드 예시에서는 describe-scaling-activities을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: 지정된 Amazon ECS 서비스에 대한 스케일링 활동을 설명하는 방법

다음 describe-scaling-activities 예제에서는 default 클러스터에서 실행 중인 web-app이라고 하는 Amazon ECS 서비스에 대한 스케일링 활동을 설명합니다. 출력은 조정 정책에 의해 시작되는 스케일링 활동을 표시합니다.

aws application-autoscaling describe-scaling-activities \ --service-namespace ecs \ --resource-id service/default/web-app

출력:

{ "ScalingActivities": [ { "ScalableDimension": "ecs:service:DesiredCount", "Description": "Setting desired count to 1.", "ResourceId": "service/default/web-app", "ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399", "StartTime": 1462575838.171, "ServiceNamespace": "ecs", "EndTime": 1462575872.111, "Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25", "StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs.", "StatusCode": "Successful" } ] }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 스케일링 활동을 참조하세요.

예제 2: 지정된 DynamoDB 테이블에 대한 스케일링 활동을 설명하는 방법

다음 describe-scaling-activities 예제에서는 TestTable이라고 하는 DynamoDB에 대한 스케일링 활동을 설명합니다. 출력은 두 가지 다른 예약된 작업에 의해 시작되는 스케일링 활동을 표시합니다.

aws application-autoscaling describe-scaling-activities \ --service-namespace dynamodb \ --resource-id table/TestTable

출력:

{ "ScalingActivities": [ { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Description": "Setting write capacity units to 10.", "ResourceId": "table/my-table", "ActivityId": "4d1308c0-bbcf-4514-a673-b0220ae38547", "StartTime": 1561574415.086, "ServiceNamespace": "dynamodb", "EndTime": 1561574449.51, "Cause": "maximum capacity was set to 10", "StatusMessage": "Successfully set write capacity units to 10. Change successfully fulfilled by dynamodb.", "StatusCode": "Successful" }, { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Description": "Setting min capacity to 5 and max capacity to 10", "ResourceId": "table/my-table", "ActivityId": "f2b7847b-721d-4e01-8ef0-0c8d3bacc1c7", "StartTime": 1561574414.644, "ServiceNamespace": "dynamodb", "Cause": "scheduled action name my-second-scheduled-action was triggered", "StatusMessage": "Successfully set min capacity to 5 and max capacity to 10", "StatusCode": "Successful" }, { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Description": "Setting write capacity units to 15.", "ResourceId": "table/my-table", "ActivityId": "d8ea4de6-9eaa-499f-b466-2cc5e681ba8b", "StartTime": 1561574108.904, "ServiceNamespace": "dynamodb", "EndTime": 1561574140.255, "Cause": "minimum capacity was set to 15", "StatusMessage": "Successfully set write capacity units to 15. Change successfully fulfilled by dynamodb.", "StatusCode": "Successful" }, { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Description": "Setting min capacity to 15 and max capacity to 20", "ResourceId": "table/my-table", "ActivityId": "3250fd06-6940-4e8e-bb1f-d494db7554d2", "StartTime": 1561574108.512, "ServiceNamespace": "dynamodb", "Cause": "scheduled action name my-first-scheduled-action was triggered", "StatusMessage": "Successfully set min capacity to 15 and max capacity to 20", "StatusCode": "Successful" } ] }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 스케일링 활동을 참조하세요.

다음 코드 예시에서는 describe-scaling-policies을 사용하는 방법을 보여 줍니다.

AWS CLI

조정 정책을 설명하는 방법

이 예제 명령은 ECS 서비스 네임스페이스에 대한 조정 정책을 설명합니다.

명령:

aws application-autoscaling describe-scaling-policies --service-namespace ecs

출력:

{ "ScalingPolicies": [ { "PolicyName": "web-app-cpu-gt-75", "ScalableDimension": "ecs:service:DesiredCount", "ResourceId": "service/default/web-app", "CreationTime": 1462561899.23, "StepScalingPolicyConfiguration": { "Cooldown": 60, "StepAdjustments": [ { "ScalingAdjustment": 200, "MetricIntervalLowerBound": 0.0 } ], "AdjustmentType": "PercentChangeInCapacity" }, "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-gt-75", "PolicyType": "StepScaling", "Alarms": [ { "AlarmName": "web-app-cpu-gt-75", "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-gt-75" } ], "ServiceNamespace": "ecs" }, { "PolicyName": "web-app-cpu-lt-25", "ScalableDimension": "ecs:service:DesiredCount", "ResourceId": "service/default/web-app", "CreationTime": 1462562575.099, "StepScalingPolicyConfiguration": { "Cooldown": 1, "StepAdjustments": [ { "ScalingAdjustment": -50, "MetricIntervalUpperBound": 0.0 } ], "AdjustmentType": "PercentChangeInCapacity" }, "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-lt-25", "PolicyType": "StepScaling", "Alarms": [ { "AlarmName": "web-app-cpu-lt-25", "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-lt-25" } ], "ServiceNamespace": "ecs" } ] }

다음 코드 예시에서는 describe-scheduled-actions을 사용하는 방법을 보여 줍니다.

AWS CLI

예약된 작업을 설명하는 방법

다음 describe-scheduled-actions 예제에서는 지정된 서비스 네임스페이스에 대한 예약된 작업의 세부 정보를 표시합니다.

aws application-autoscaling describe-scheduled-actions \ --service-namespace dynamodb

출력:

{ "ScheduledActions": [ { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Schedule": "at(2019-05-20T18:35:00)", "ResourceId": "table/my-table", "CreationTime": 1561571888.361, "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-first-scheduled-action", "ScalableTargetAction": { "MinCapacity": 15, "MaxCapacity": 20 }, "ScheduledActionName": "my-first-scheduled-action", "ServiceNamespace": "dynamodb" }, { "ScalableDimension": "dynamodb:table:WriteCapacityUnits", "Schedule": "at(2019-05-20T18:40:00)", "ResourceId": "table/my-table", "CreationTime": 1561571946.021, "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-second-scheduled-action", "ScalableTargetAction": { "MinCapacity": 5, "MaxCapacity": 10 }, "ScheduledActionName": "my-second-scheduled-action", "ServiceNamespace": "dynamodb" } ] }

자세한 내용은 https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.htmlApplication Auto Scaling 사용 설명서의 예약된 조정을 참조하세요.

다음 코드 예시에서는 list-tags-for-resource을 사용하는 방법을 보여 줍니다.

AWS CLI

확장 가능 대상에 대한 태그를 나열하는 방법

다음 list-tags-for-resource 예제에서는 ARN에 의해 지정된 확장 가능 대상에 연결된 태그 키 이름과 값을 나열합니다.

aws application-autoscaling list-tags-for-resource \ --resource-arn arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123

출력:

{ "Tags": { "environment": "production" } }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 태그 지정 지원을 참조하세요.

다음 코드 예시에서는 put-scaling-policy을 사용하는 방법을 보여 줍니다.

AWS CLI

예 1: 사전 정의된 지표 사양을 사용하여 대상 추적 조정 정책 적용

다음 put-scaling-policy 예제에서는 기본 클러스터에서 미리 정의된 지표 사양이 있는 대상 추적 조정 정책을 웹앱이라고 하는 Amazon ECS 서비스에 적용합니다. 이 정책은 60초의 스케일 아웃 및 스케일 인 휴지 기간을 사용하여 서비스의 평균 CPU 사용률을 75%로 유지합니다. 출력에는 ARN과 사용자를 대신하여 생성된 두 개의 CloudWatch 경보 이름이 포함됩니다.

aws application-autoscaling put-scaling-policy --service-namespace ecs \ --scalable-dimension ecs:service:DesiredCount \ --resource-id service/default/web-app \ --policy-name cpu75-target-tracking-scaling-policy --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration file://config.json

이 예제에서는 현재 디렉터리에 다음 콘텐츠가 포함된 config.json 파일이 있다고 가정합니다.

{ "TargetValue": 75.0, "PredefinedMetricSpecification": { "PredefinedMetricType": "ECSServiceAverageCPUUtilization" }, "ScaleOutCooldown": 60, "ScaleInCooldown": 60 }

출력:

{ "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/cpu75-target-tracking-scaling-policy", "Alarms": [ { "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca", "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca" }, { "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d", "AlarmName": "TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d" } ] }

예 2: 사용자 지정된 지표 사양을 사용하여 대상 추적 조정 정책 적용

다음 put-scaling-policy 예제에서는 기본 클러스터에서 사용자 지정 지표 사양이 있는 대상 추적 조정 정책을 웹앱이라고 하는 Amazon ECS 서비스에 적용합니다. 이 정책은 60초의 스케일 아웃 및 스케일 인 휴지 기간을 사용하여 서비스의 평균 사용률을 75%로 유지합니다. 출력에는 ARN과 사용자를 대신하여 생성된 두 개의 CloudWatch 경보 이름이 포함됩니다.

aws application-autoscaling put-scaling-policy --service-namespace ecs \ --scalable-dimension ecs:service:DesiredCount \ --resource-id service/default/web-app \ --policy-name cms75-target-tracking-scaling-policy --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration file://config.json

이 예제에서는 현재 디렉터리에 다음 콘텐츠가 포함된 config.json 파일이 있다고 가정합니다.

{ "TargetValue":75.0, "CustomizedMetricSpecification":{ "MetricName":"MyUtilizationMetric", "Namespace":"MyNamespace", "Dimensions": [ { "Name":"MyOptionalMetricDimensionName", "Value":"MyOptionalMetricDimensionValue" } ], "Statistic":"Average", "Unit":"Percent" }, "ScaleOutCooldown": 60, "ScaleInCooldown": 60 }

출력:

{ "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy: 8784a896-b2ba-47a1-b08c-27301cc499a1:resource/ecs/service/default/web-app:policyName/cms75-target-tracking-scaling-policy", "Alarms": [ { "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0", "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0" }, { "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4", "AlarmName": "TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4" } ] }

예 3: 스케일 아웃을 위한 대상 추적 조정 정책 적용

다음 put-scaling-policy 예제에서는 기본 클러스터에서 대상 추적 조정 정책을 web-app이라고 하는 Amazon ECS 서비스에 적용합니다. 정책은 Application Load Balancer의 RequestCountPerTarget 지표가 임계값을 초과할 때 ECS 서비스를 스케일 아웃하는 데 사용됩니다. 출력에는 ARN과 사용자를 대신하여 생성된 CloudWatch 경보 이름이 포함됩니다.

aws application-autoscaling put-scaling-policy \ --service-namespace ecs \ --scalable-dimension ecs:service:DesiredCount \ --resource-id service/default/web-app \ --policy-name alb-scale-out-target-tracking-scaling-policy \ --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration file://config.json

config.json의 콘텐츠:

{ "TargetValue": 1000.0, "PredefinedMetricSpecification": { "PredefinedMetricType": "ALBRequestCountPerTarget", "ResourceLabel": "app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d" }, "ScaleOutCooldown": 60, "ScaleInCooldown": 60, "DisableScaleIn": true }

출력:

{ "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/alb-scale-out-target-tracking-scaling-policy", "Alarms": [ { "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca", "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca" } ] }

자세한 내용은 AWS Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 대상 추적 조정 정책을 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조PutScalingPolicy를 참조하세요.

다음 코드 예시에서는 put-scheduled-action을 사용하는 방법을 보여 줍니다.

AWS CLI

DynamoDB 테이블에 예약된 작업을 추가하는 방법

이 예제에서는 TestTable이라고 하는 DynamoDB 테이블에 예약된 작업을 추가하여 반복 일정으로 스케일 아웃합니다. 지정된 일정(UTC 기준 매일 오후 12시 15분)에서 현재 용량이 MinCapacity에 대해 지정된 값보다 작은 경우 Application Auto Scaling은 MinCapacity에 의해 지정된 값으로 스케일 아웃됩니다.

명령:

aws application-autoscaling put-scheduled-action --service-namespace dynamodb --scheduled-action-name my-recurring-action --schedule "cron(15 12 * * ? *)" --resource-id table/TestTable --scalable-dimension dynamodb:table:WriteCapacityUnits --scalable-target-action MinCapacity=6

자세한 내용은 Application Auto Scaling 사용 설명서의 예약된 조정을 참조하세요.

다음 코드 예시에서는 register-scalable-target을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: ECS 서비스를 확장 가능 대상으로 등록하는 방법

다음 register-scalable-target 예제에서는 Application Auto Scaling에 Amazon ECS 서비스를 등록합니다. 또한 키 이름 environmentproduction 값을 갖는 태그를 확장 가능 대상에 추가합니다.

aws application-autoscaling register-scalable-target \ --service-namespace ecs \ --scalable-dimension ecs:service:DesiredCount \ --resource-id service/default/web-app \ --min-capacity 1 --max-capacity 10 \ --tags environment=production

출력:

{ "ScalableTargetARN": "arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123" }

다른 AWS 서비스 및 사용자 지정 리소스에 대한 예제는 Application Auto Scaling 사용 설명서Application Auto Scaling과 함께 사용할 수 있는 AWS 서비스 주제를 참조하세요.

예제 2: 확장 가능 대상에 대한 스케일링 활동을 중단하는 방법

다음 register-scalable-target 예제에서는 기존 확장 가능 대상에 대한 조정 활동을 중단합니다.

aws application-autoscaling register-scalable-target \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/my-table \ --suspended-state DynamicScalingInSuspended=true,DynamicScalingOutSuspended=true,ScheduledScalingSuspended=true

출력:

{ "ScalableTargetARN": "arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123" }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 스케일링 중단 및 재개를 참조하세요.

예제 3: 확장 가능 대상에 대한 스케일링 활동을 재개하는 방법

다음 register-scalable-target 예제에서는 기존 확장 가능 대상에 대한 조정 활동을 재개합니다.

aws application-autoscaling register-scalable-target \ --service-namespace dynamodb \ --scalable-dimension dynamodb:table:ReadCapacityUnits \ --resource-id table/my-table \ --suspended-state DynamicScalingInSuspended=false,DynamicScalingOutSuspended=false,ScheduledScalingSuspended=false

출력:

{ "ScalableTargetARN": "arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123" }

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 스케일링 중단 및 재개를 참조하세요.

다음 코드 예시에서는 tag-resource을 사용하는 방법을 보여 줍니다.

AWS CLI

확장 가능 대상에 태그를 추가하는 방법

다음 tag-resource 예제에서는 키 이름 environmentproduction 값을 갖는 태그를 ARN에 의해 지정된 확장 가능 대상에 추가합니다.

aws application-autoscaling tag-resource \ --resource-arn arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123 \ --tags environment=production

이 명령은 출력을 생성하지 않습니다.

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 태그 지정 지원을 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조의 TagResource를 참조하세요.

다음 코드 예시에서는 untag-resource을 사용하는 방법을 보여 줍니다.

AWS CLI

확장 가능 대상에서 태그를 제거하는 방법

다음 untag-resource 예제에서는 ARN에 의해 지정된 확장 가능 대상에서 키 이름 environment를 갖는 태그 페어를 제거합니다.

aws application-autoscaling untag-resource \ --resource-arn arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123 \ --tag-keys "environment"

이 명령은 출력을 생성하지 않습니다.

자세한 내용은 Application Auto Scaling 사용 설명서Application Auto Scaling에 대한 태그 지정 지원을 참조하세요.

  • API 세부 정보는 AWS CLI Command Reference의 UntagResource를 참조하세요.