

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

# Amazon Cognito 리소스 태깅
<a name="tagging"></a>

*태그*는 사용자 또는가 리소스에 AWS 할당하는 메타데이터 레이블입니다 AWS . 각 태그는 *키*와 *값*으로 구성됩니다. 사용자가 할당하는 태그에 대해 키와 값을 정의합니다. 예를 들어 키를 `stage`로 정의하고 리소스 하나의 값을 `test`로 정의할 수 있습니다.

태그는 다음을 지원합니다.
+  AWS 리소스를 식별하고 구성합니다. 많은 AWS 서비스가 태그 지정을 지원하므로 다른 서비스의 리소스에 동일한 태그를 할당할 수 있습니다. 이렇게 하면 어떤 리소스가 관련되어 있는지 알 수 있습니다. 예를 들어 Amazon DynamoDB 테이블에 할당한 것과 동일한 태그를 Amazon Cognito 사용자 풀에 할당할 수 있습니다.
+  AWS 비용을 추적합니다. AWS 결제 및 비용 관리 대시보드에서 이러한 태그를 활성화할 수 있습니다. AWS 는 비용 할당 태그를 사용하여 비용을 분류하고 월별 비용 할당 보고서를 제공합니다. 자세한 내용은 *AWS Billing 사용 설명서*의 [비용 할당 태그 사용](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)을 참조하세요.
+ 할당된 태그를 기반으로 리소스에 대한 액세스를 제어합니다. AWS Identity and Access Management (IAM) 정책 조건에서 태그 키와 값을 지정하여 액세스를 제어할 수 있습니다. 예를 들어 사용자 풀에 값이 해당 사용자의 이름인 `owner` 태그가 있을 때만 사용자가 사용자 풀을 업데이트하도록 허용할 수 있습니다. 자세한 내용은 *IAM 사용 설명서*의 [태그를 사용한 액세스 제어](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)를 참조하십시오.

 AWS Command Line Interface 또는 Amazon Cognito API를 사용하여 사용자 및 자격 증명 풀 모두에 대한 태그를 추가, 편집 또는 삭제할 수 있습니다. Amazon Cognito 콘솔을 사용하여 사용자 풀에 대한 태그를 관리할 수도 있습니다.

태그 사용 방법에 대한 팁은 *AWS Answers* 블로그의 [AWS 태깅 전략](https://aws.amazon.com/answers/account-management/aws-tagging-strategies/) 게시글을 참조하세요.

다음 섹션에서는 Amazon Cognito의 태그에 대한 추가 정보를 제공합니다.

## Amazon Cognito에서 지원되는 리소스
<a name="tagging-supported-resources"></a>

Amazon Cognito의 다음 리소스는 태깅을 지원합니다.
+ 사용자 풀
+ ID 풀

## 태그 제한 사항
<a name="tagging-restrictions"></a>

Amazon Cognito 리소스에 대한 태그에 적용되는 제한 사항은 다음과 같습니다.
+ 리소스에 할당할 수 있는 최대 태그 수 - 50개 
+ 최대 키 길이 - 유니코드 128자 
+ 최대 값 길이 - 유니코드 256자 
+ 키 및 값에 사용할 수 있는 문자 - a-z, A-Z, 0-9, 공백, \$1 . : / = \$1 - @ 문자
+ 키와 값은 대/소문자를 구분합니다.
+ 키 접두사로 `aws:`를 사용하지 마세요. AWS 전용입니다.

## Amazon Cognito 콘솔을 사용하여 태그 관리
<a name="tagging-console"></a>

Amazon Cognito 콘솔을 사용하여 사용자 풀에 할당된 태그를 관리할 수 있습니다.

**사용자 풀에 태그를 추가하려면**

1. [Amazon Cognito 콘솔](https://console.aws.amazon.com/cognito/home)로 이동합니다. 메시지가 표시되면 자격 AWS 증명을 입력합니다.

1. [**사용자 풀(User Pools)**]을 선택합니다.

1. 목록에서 기존 사용자 풀을 선택하거나 [사용자 풀을 생성합니다](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-as-user-directory.html).

1. **설정** 메뉴를 선택하고 **태그** 탭을 찾습니다.

1. [**태그 추가(Add tags)**]를 선택하여 첫 번째 태그를 추가합니다. 이전에 이 사용자 풀에 태그를 할당한 경우 [**태그 관리(Manage tags)**]에서 [**다른 태그 추가(Add another)**]를 선택합니다.

1. **태그 키(Tag Key)**와 **태그 값(Tag Value)**의 값을 지정합니다.

1. 추가하려는 각 태그에 대해 [**다른 태그 추가(Add another)**]를 선택합니다.

1. 태그 추가가 완료되면 **변경 사항 저장(Save changes)**을 선택합니다.

ID 풀에 태그를 지정하려면 **ID 풀** 메뉴로 이동하여 ID 풀을 선택하거나 생성합니다. **ID 풀 속성** 탭에서 **태그**를 찾습니다. **태그 추가**를 선택합니다.

## AWS CLI 예제
<a name="tagging-cli-examples"></a>

는 Amazon Cognito 사용자 풀 및 자격 증명 풀에 할당하는 태그를 관리하는 데 도움이 되는 명령을 AWS CLI 제공합니다.

### 태그 할당
<a name="tagging-cli-examples-assigning"></a>

다음 명령을 사용하여 기존 사용자 풀 및 자격 증명 풀에 태그를 할당합니다.

**Example 사용자 풀에 대한 `tag-resource` 명령**  
`cognito-idp` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/tag-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/tag-resource.html)를 사용하여 사용자 풀에 태그를 할당합니다.  

```
$ aws cognito-idp tag-resource \
> --resource-arn user-pool-arn \
> --tags Stage=Test
```
이 명령에는 다음 파라미터가 포함되어 있습니다.  
+ `resource-arn` - 태그를 적용할 사용자 풀의 Amazon 리소스 이름(ARN)입니다. ARN을 조회하려면 Amazon Cognito 콘솔에서 사용자 풀을 선택하고 **일반 설정(General settings)** 탭에서 **풀 ARN(Pool ARN)** 값을 확인합니다.
+ `tags` - 태그의 키-값 페어(`key=value` 포맷)입니다.
여러 태그를 한 번에 할당하려면 쉼표로 구분된 목록으로 지정합니다.  

```
$ aws cognito-idp tag-resource \
> --resource-arn user-pool-arn \
> --tags Stage=Test,CostCenter=80432,Owner=SysEng
```

**Example 자격 증명 풀에 대한 `tag-resource` 명령**  
`cognito-identity` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/tag-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/tag-resource.html)를 사용하여 자격 증명 풀에 태그를 할당합니다.  

```
$ aws cognito-identity tag-resource \
> --resource-arn identity-pool-arn \
> --tags Stage=Test
```
이 명령에는 다음 파라미터가 포함되어 있습니다.  
+ `resource-arn` - 태그를 적용할 자격 증명 풀의 Amazon 리소스 이름(ARN)입니다. ARN을 조회하려면 Amazon Cognito 콘솔에서 자격 증명 풀을 선택하고 [**자격 증명 풀 편집(Edit identity pool)**]을 선택합니다. 그런 다음 **자격 증명 풀 ID(Identity pool ID)**에서 **ARN 표시(Show ARN)**를 선택합니다.
+ `tags` - 태그의 키-값 페어(`key=value` 포맷)입니다.
여러 태그를 한 번에 할당하려면 쉼표로 구분된 목록으로 지정합니다.  

```
$ aws cognito-identity tag-resource \
> --resource-arn identity-pool-arn \
> --tags Stage=Test,CostCenter=80432,Owner=SysEng
```

### 태그 보기
<a name="tagging-cli-examples-viewing"></a>

다음 명령을 사용하여 사용자 풀 및 자격 증명 풀에 할당한 태그를 봅니다.

**Example 사용자 풀에 대한 `list-tags-for-resource` 명령**  
`cognito-idp` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/list-tags-for-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/list-tags-for-resource.html)를 사용하여 사용자 풀에 할당한 태그를 봅니다.  

```
$ aws cognito-idp list-tags-for-resource --resource-arn user-pool-arn
```

**Example 자격 증명 풀에 대한 `list-tags-for-resource` 명령**  
`cognito-identity` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/list-tags-for-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/list-tags-for-resource.html)를 사용하여 자격 증명 풀에 할당한 태그를 봅니다.  

```
$ aws cognito-identity list-tags-for-resource --resource-arn identity-pool-arn
```

### 태그 제거
<a name="tagging-cli-examples-removing"></a>

다음 명령을 사용하여 사용자 풀 및 자격 증명 풀에서 태그를 제거합니다.

**Example 사용자 풀에 대한 `untag-resource` 명령**  
`cognito-idp` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/untag-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/untag-resource.html)를 사용하여 사용자 풀에서 태그를 제거합니다.  

```
$ aws cognito-idp untag-resource \
> --resource-arn user-pool-arn \
> --tag-keys Stage CostCenter Owner
```
`--tag-keys` 파라미터의 경우 태그 키를 하나 이상 지정합니다. 태그 값을 포함해서는 안 됩니다. 키를 공백으로 구분합니다.

**Example 자격 증명 풀에 대한 `untag-resource` 명령**  
`cognito-identity` 명령 세트에서 [https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/untag-resource.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/untag-resource.html)를 사용하여 자격 증명 풀에서 태그를 제거합니다.  

```
$ aws cognito-identity untag-resource \
> --resource-arn identity-pool-arn \
> --tag-keys Stage CostCenter Owner
```
`--tag-keys` 파라미터의 경우 태그 키를 하나 이상 지정합니다. 태그 값을 포함해서는 안 됩니다.

**중요**  
사용자 또는 자격 증명 풀을 삭제한 후에도 삭제된 풀과 관련한 태그가 삭제 후 최대 30일 동안 콘솔 또는 API 호출에 계속 표시될 수 있습니다.

### 리소스를 생성할 때 태그 적용
<a name="tagging-cli-examples-applying"></a>

다음 명령을 사용하여 사용자 풀 또는 자격 증명 풀을 생성할 때 태그를 할당합니다.

**Example 태그가 있는 `create-user-pool` 명령**  
[https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/create-user-pool.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/create-user-pool.html) 명령을 사용하여 사용자 풀을 생성할 때 `--user-pool-tags` 파라미터로 태그를 지정할 수 있습니다.  

```
$ aws cognito-idp create-user-pool \
> --pool-name user-pool-name \
> --user-pool-tags Stage=Test,CostCenter=80432,Owner=SysEng
```
태그의 키-값 페어는 `key=value` 포맷이어야 합니다. 여러 태그를 추가하는 경우 태그를 쉼표로 구분된 목록으로 지정합니다.

**Example 태그가 있는 `create-identity-pool` 명령**  
[https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/create-identity-pool.html](https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/create-identity-pool.html) 명령을 사용하여 자격 증명 풀을 생성할 때 `--identity-pool-tags` 파라미터로 태그를 지정할 수 있습니다.  

```
$ aws cognito-identity create-identity-pool \
> --identity-pool-name identity-pool-name \
> --allow-unauthenticated-identities \
> --identity-pool-tags Stage=Test,CostCenter=80432,Owner=SysEng
```
태그의 키-값 페어는 `key=value` 포맷이어야 합니다. 여러 태그를 추가하는 경우 태그를 쉼표로 구분된 목록으로 지정합니다.

## Amazon Cognito API를 사용하여 태그 관리
<a name="tagging-api"></a>

Amazon Cognito API에서 다음 작업을 사용하여 사용자 풀 및 자격 증명 풀의 태그를 관리할 수 있습니다.

### 사용자 풀 태그에 대한 API 작업
<a name="tagging-api-user-pools"></a>

다음 API 작업을 사용하여 사용자 풀에 대한 태그를 할당하고 보고 제거합니다.
+ [TagResource](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_TagResource.html)
+ [ListTagsForResource](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListTagsForResource.html)
+ [UntagResource](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UntagResource.html)
+ [CreateUserPool](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPool.html)

### 자격 증명 풀 태그에 대한 API 작업
<a name="tagging-api-identity-pools"></a>

다음 API 작업을 사용하여 자격 증명 풀에 대한 태그를 할당하고 보고 제거합니다.
+ [TagResource](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_TagResource.html)
+ [ListTagsForResource](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_ListTagsForResource.html)
+ [UntagResource](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_UntagResource.html)
+ [CreateIdentityPool](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_CreateIdentityPool.html)