

# 용량 예약 정책 예제
<a name="example-policies-capacity-reservations"></a>

이 섹션에서는 용량 예약에서 다양한 작업을 활성화하는 데 사용할 수 있는 정책 예제를 설명합니다. IAM 정책을 사용할 때마다 IAM 모범 사례를 따라야 합니다. 자세한 내용은 *IAM 사용 설명서*의 [IAM 보안 모범 사례](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)를 참조하세요.

용량 예약은 Athena가 관리하는 IAM 리소스입니다. 따라서 용량 예약 정책에서 `capacity-reservation`을 입력으로 사용하는 작업을 사용할 경우 다음과 같이 용량 예약의 ARN을 지정해야 합니다.

```
"Resource": [arn:aws:athena:<region>:<user-account>:capacity-reservation/<capacity-reservation-name>]
```

여기에서 `<capacity-reservation-name>`은 용량 예약 이름입니다. 예를 들어 다음과 같이 `test_capacity_reservation`이라는 용량 예약에서 이를 리소스로 지정합니다.

```
"Resource": ["arn:aws:athena:us-east-1:123456789012:capacity-reservation/test_capacity_reservation"]
```

Amazon Athena 작업의 전체 목록은 [Amazon Athena API 참조](https://docs.aws.amazon.com/athena/latest/APIReference/)의 API 작업 이름을 참조하세요. IAM 정책에 대한 자세한 내용은 *IAM 사용 설명서*의 [시각적 편집기로 정책 생성](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html#access_policies_create-visual-editor)을 참조하세요.

**Example 용량 예약을 나열하는 정책 예제**  
다음 정책에서는 모든 사용자가 모든 용량 예약을 나열하도록 허용합니다.    
****  

```
{ 
    "Version":"2012-10-17",		 	 	  
    "Statement": [ 
        { 
            "Effect": "Allow", 
            "Action": [ 
                "athena:ListCapacityReservations" 
            ], 
            "Resource": "*" 
        } 
    ] 
}
```

**Example 관리 작업을 위한 정책 예제**  
다음 정책에서는 사용자가 `test_capacity_reservation` 용량 예약을 생성 및 취소하고 세부 정보를 확인하며 업데이트하도록 허용합니다. 또한 이 정책에서는 사용자가 `workgroupA` 및 `workgroupB`를 `test_capacity_reservation`에 할당하도록 허용합니다.    
****  

```
{ 
   "Version":"2012-10-17",		 	 	  
   "Statement":[ 
      { 
         "Effect": "Allow", 
         "Action": [ 
             "athena:CreateCapacityReservation", 
             "athena:GetCapacityReservation", 
             "athena:CancelCapacityReservation", 
             "athena:UpdateCapacityReservation", 
             "athena:GetCapacityAssignmentConfiguration", 
             "athena:PutCapacityAssignmentConfiguration" 
         ], 
         "Resource": [ 
             "arn:aws:athena:us-east-1:123456789012:capacity-reservation/test_capacity_reservation", 
             "arn:aws:athena:us-east-1:123456789012:workgroup/workgroupA", 
             "arn:aws:athena:us-east-1:123456789012:workgroup/workgroupB" 
         ] 
      } 
   ] 
}
```