

버전 5(V5) AWS Tools for PowerShell 가 릴리스되었습니다.

변경 사항 해제 및 애플리케이션 마이그레이션에 대한 자세한 내용은 [마이그레이션 주제를](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html) 참조하세요.

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Tools for PowerShell V5를 사용한 Application Auto Scaling 예제
<a name="powershell_application-auto-scaling_code_examples"></a>

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

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

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

**Topics**
+ [작업](#actions)

## 작업
<a name="actions"></a>

### `Add-AASScalableTarget`
<a name="application-auto-scaling_RegisterScalableTarget_powershell_topic"></a>

다음 코드 예시는 `Add-AASScalableTarget`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 규모 조정 가능 대상을 등록하거나 업데이트합니다. 규모 조정 가능 대상은 Application Auto Scaling에서 스케일 아웃 및 스케일 인할 수 있는 리소스입니다.**  

```
Add-AASScalableTarget -ServiceNamespace AppStream -ResourceId fleet/MyFleet -ScalableDimension appstream:fleet:DesiredCapacity -MinCapacity 2 -MaxCapacity 10
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [RegisterScalableTarget](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-AASScalableTarget`
<a name="application-auto-scaling_DescribeScalableTargets_powershell_topic"></a>

다음 코드 예시는 `Get-AASScalableTarget`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 네임스페이스의 Application Auto Scaling 규모 조정 가능 대상에 대한 정보를 제공합니다.**  

```
Get-AASScalableTarget -ServiceNamespace "AppStream"
```
**출력:**  

```
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
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeScalableTargets](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-AASScalingActivity`
<a name="application-auto-scaling_DescribeScalingActivities_powershell_topic"></a>

다음 코드 예시는 `Get-AASScalingActivity`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이전 6주 동안 지정된 서비스 네임스페이스의 조정 활동에 대한 설명이 포함된 정보를 제공합니다.**  

```
Get-AASScalingActivity -ServiceNamespace AppStream
```
**출력:**  

```
ActivityId        : 2827409f-b639-4cdb-a957-8055d5d07434
Cause             : monitor alarm Appstream2-MyFleet-default-scale-in-Alarm in state ALARM triggered policy default-scale-in
Description       : Setting desired capacity to 2.
Details           :
EndTime           : 12/14/2019 11:32:49 AM
ResourceId        : fleet/MyFleet
ScalableDimension : appstream:fleet:DesiredCapacity
ServiceNamespace  : appstream
StartTime         : 12/14/2019 11:32:14 AM
StatusCode        : Successful
StatusMessage     : Successfully set desired capacity to 2. Change successfully fulfilled by appstream.
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeScalingActivities](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-AASScalingPolicy`
<a name="application-auto-scaling_DescribeScalingPolicies_powershell_topic"></a>

다음 코드 예시는 `Get-AASScalingPolicy`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 지정된 서비스 네임스페이스에 대한 Application Auto Scaling 조정 정책을 설명합니다.**  

```
Get-AASScalingPolicy -ServiceNamespace AppStream
```
**출력:**  

```
Alarms                                   : {Appstream2-LabFleet-default-scale-out-Alarm}
CreationTime                             : 9/3/2019 2:48:15 AM
PolicyARN                                : arn:aws:autoscaling:us-west-2:012345678912:scalingPolicy:5659b069-b5cd-4af1-9f7f-3e956d36233e:resource/appstream/fleet/LabFleet:
                                           policyName/default-scale-out
PolicyName                               : default-scale-out
PolicyType                               : StepScaling
ResourceId                               : fleet/LabFleet
ScalableDimension                        : appstream:fleet:DesiredCapacity
ServiceNamespace                         : appstream
StepScalingPolicyConfiguration           : Amazon.ApplicationAutoScaling.Model.StepScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration :

Alarms                                   : {Appstream2-LabFleet-default-scale-in-Alarm}
CreationTime                             : 9/3/2019 2:48:15 AM
PolicyARN                                : arn:aws:autoscaling:us-west-2:012345678912:scalingPolicy:5659b069-b5cd-4af1-9f7f-3e956d36233e:resource/appstream/fleet/LabFleet:
                                           policyName/default-scale-in
PolicyName                               : default-scale-in
PolicyType                               : StepScaling
ResourceId                               : fleet/LabFleet
ScalableDimension                        : appstream:fleet:DesiredCapacity
ServiceNamespace                         : appstream
StepScalingPolicyConfiguration           : Amazon.ApplicationAutoScaling.Model.StepScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration :
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeScalingPolicies](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-AASScheduledAction`
<a name="application-auto-scaling_DescribeScheduledActions_powershell_topic"></a>

다음 코드 예시는 `Get-AASScheduledAction`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 실행되지 않았거나 종료 시간에 도달하지 않은 Auto Scaling 그룹에 예약된 작업을 나열합니다.**  

```
Get-AASScheduledAction -ServiceNamespace AppStream
```
**출력:**  

```
CreationTime         : 12/22/2019 9:25:52 AM
EndTime              : 1/1/0001 12:00:00 AM
ResourceId           : fleet/MyFleet
ScalableDimension    : appstream:fleet:DesiredCapacity
ScalableTargetAction : Amazon.ApplicationAutoScaling.Model.ScalableTargetAction
Schedule             : cron(0 0 8 ? * MON-FRI *)
ScheduledActionARN   : arn:aws:autoscaling:us-west-2:012345678912:scheduledAction:4897ca24-3caa-4bf1-8484-851a089b243c:resource/appstream/fleet/MyFleet:scheduledActionName
                       /WeekDaysFleetScaling
ScheduledActionName  : WeekDaysFleetScaling
ServiceNamespace     : appstream
StartTime            : 1/1/0001 12:00:00 AM
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeScheduledActions](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-AASScalableTarget`
<a name="application-auto-scaling_DeregisterScalableTarget_powershell_topic"></a>

다음 코드 예시는 `Remove-AASScalableTarget`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 Application Auto Scaling 규모 조정 가능 대상의 등록을 취소합니다. 규모 조정 가능 대상의 등록을 취소하면 연결된 조정 정책이 삭제됩니다.**  

```
Remove-AASScalableTarget -ResourceId fleet/MyFleet -ScalableDimension appstream:fleet:DesiredCapacity -ServiceNamespace AppStream
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-AASScalableTarget (DeregisterScalableTarget)" on target "fleet/MyFleet".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeregisterScalableTarget](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-AASScalingPolicy`
<a name="application-auto-scaling_DeleteScalingPolicy_powershell_topic"></a>

다음 코드 예시는 `Remove-AASScalingPolicy`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet은 Application Auto Scaling 규모 조정 가능 대상에 대해 지정된 조정 정책을 삭제합니다.**  

```
Remove-AASScalingPolicy -ServiceNamespace AppStream -PolicyName "default-scale-out" -ResourceId fleet/Test -ScalableDimension appstream:fleet:DesiredCapacity
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteScalingPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-AASScheduledAction`
<a name="application-auto-scaling_DeleteScheduledAction_powershell_topic"></a>

다음 코드 예시는 `Remove-AASScheduledAction`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet은 Application Auto Scaling 규모 조정 가능 대상에 대해 지정된 예약된 작업을 삭제합니다.**  

```
Remove-AASScheduledAction -ServiceNamespace AppStream -ScheduledActionName WeekDaysFleetScaling -ResourceId fleet/MyFleet -ScalableDimension appstream:fleet:DesiredCapacity
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-AASScheduledAction (DeleteScheduledAction)" on target "WeekDaysFleetScaling".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteScheduledAction](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Set-AASScalingPolicy`
<a name="application-auto-scaling_PutScalingPolicy_powershell_topic"></a>

다음 코드 예시는 `Set-AASScalingPolicy`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 Application Auto Scaling 규모 조정 가능 대상에 대한 정책을 생성 또는 업데이트합니다. 각 규모 조정 가능 대상은 서비스 네임스페이스, 리소스 ID 및 규모 조정 가능 차원으로 식별됩니다.**  

```
Set-AASScalingPolicy -ServiceNamespace AppStream -PolicyName ASFleetScaleInPolicy -PolicyType StepScaling  -ResourceId fleet/MyFleet -ScalableDimension appstream:fleet:DesiredCapacity -StepScalingPolicyConfiguration_AdjustmentType ChangeInCapacity -StepScalingPolicyConfiguration_Cooldown 360 -StepScalingPolicyConfiguration_MetricAggregationType Average -StepScalingPolicyConfiguration_StepAdjustments @{ScalingAdjustment = -1; MetricIntervalUpperBound = 0}
```
**출력:**  

```
Alarms    PolicyARN
------    ---------
{}        arn:aws:autoscaling:us-west-2:012345678912:scalingPolicy:4897ca24-3caa-4bf1-8484-851a089b243c:resource/appstream/fleet/MyFleet:policyName/ASFleetScaleInPolicy
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutScalingPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Set-AASScheduledAction`
<a name="application-auto-scaling_PutScheduledAction_powershell_topic"></a>

다음 코드 예시는 `Set-AASScheduledAction`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet에서는 Application Auto Scaling 규모 조정 가능 대상에 대한 예약된 작업을 생성 또는 업데이트합니다. 각 규모 조정 가능 대상은 서비스 네임스페이스, 리소스 ID 및 규모 조정 가능 차원으로 식별됩니다.**  

```
Set-AASScheduledAction -ServiceNamespace AppStream -ResourceId fleet/MyFleet -Schedule "cron(0 0 8 ? * MON-FRI *)" -ScalableDimension appstream:fleet:DesiredCapacity -ScheduledActionName WeekDaysFleetScaling -ScalableTargetAction_MinCapacity 5 -ScalableTargetAction_MaxCapacity 10
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutScheduledAction](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.