

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

# 리소스에 태그 지정
<a name="tagging"></a>

태그는 리소스를 좀 더 쉽게 식별하고 정리하고 검색하기 위해 리소스에 추가할 수 있는 사용자 지정 메타데이터 레이블입니다. 태그는 태그 키와 태그 값이라는 두 개의 개별 부분으로 구성됩니다. 이를 키:값 페어라고 합니다.

태그 키는 일반적으로 더 큰 범주를 나타내고 태그 값은 해당 범주의 하위 집합을 나타냅니다. 예를 들어 *태그 키=색상* 및 *태그 값=파란색*을 지정하면 키:값 페어 `Color:Blue`가 생성됩니다. 태그의 값을 빈 문자열로 설정할 수 있지만 태그의 값을 Null로 설정할 수는 없습니다. 태그 값을 생략하는 것은 빈 문자열을 사용하는 것과 같습니다.

**작은 정보**  
AWS 결제 및 비용 관리는 태그를 사용하여 청구서를 동적 범주로 구분할 수 있습니다. 예를 들어 회사 내 여러 부서를 나타내는 태그를 추가하는 경우(예: `Department:Sales` 또는`Department:Legal`) AWS는 부서별 비용 분배를 제공할 수 있습니다.

Amazon Transcribe에서 다음 리소스에 태그를 지정할 수 있습니다.
+ 트랜스크립션 작업
+ 의료 트랜스크립션 작업
+ 통화 분석 통화 후 트랜스크립션 작업
+ 사용자 지정 어휘
+ 사용자 지정 의학 어휘
+ 사용자 지정 어휘 필터
+ 통화 분석 범주
+ 사용자 지정 언어 모델

태그 키는 최대 길이가 128자이고 태그 값은 최대 길이가 256자일 수 있으며 둘 다 대소문자를 구분합니다. Amazon Transcribe는 리소스당 최대 50개의 태그를 지원합니다. 지정된 리소스에 대해 각 태그 키는 하나의 값만 가질 수 있습니다. AWS는 시스템 생성 태그에 대해 이 접두사를 예약하기 때문에 태그는 `aws:`로 시작할 수 없습니다. `aws:*` 태그는 추가, 수정 또는 삭제할 수 없으며 리소스당 태그 수 제한에 포함되지 않습니다.

**리소스 태깅과 관련된 API 작업**  
 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_ListTagsForResource.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_ListTagsForResource.html), [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TagResource.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TagResource.html), [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_UntagResource.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_UntagResource.html)   
태그 지정 API를 사용하려면 Amazon 리소스 이름(ARN)을 요청에 포함해야 합니다. ARN의 형식은 `arn:partition:service:region:account-id:resource-type/resource-id`입니다. 예를 들어, 트랜스크립션 작업과 관련된 ARN은 `arn:aws:transcribe:us-west-2:111122223333:transcription-job/my-transcription-job-name`과 비슷한 모습일 수 있습니다.

모범 사례를 포함한 태깅에 대한 자세한 내용은 [AWS 리소스 태깅](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)을 참조하세요.

## 태그 기반 액세스 제어
<a name="tagging-access-control"></a>

태그를 사용하여 AWS 계정 내의 액세스를 제어할 수 있습니다. 태그를 기반으로 액세스를 제어하려면 IAM 정책의 조건 요소에 태그 정보를 제공합니다. 그런 다음 태그 및 연관된 태그 조건 키를 사용하여 다음에 대한 액세스를 제어할 수 있습니다.
+ **리소스:** 리소스에 할당한 태그를 기반으로 Amazon Transcribe 리소스에 대한 액세스를 제어합니다.
  + 이를 위해 `aws:ResourceTag/key-name` 조건 키를 사용하여 리소스에 연결해야 하는 태그 키:값 페어를 지정합니다.
+ **요청:** 어떤 태그가 요청에 전달될 수 있는지 제어합니다.
  + `aws:RequestTag/key-name` 조건 키를 사용하여 어떤 태그를 IAM 사용자 또는 역할에서 추가, 수정 또는 제거할 수 있는지 지정합니다.
+ **권한 부여 프로세스:** 권한 부여 프로세스의 모든 부분에 대한 태그 기반 액세스를 제어합니다.
  +  `aws:TagKeys/` 조건 키를 사용하여 리소스나 요청에서 또는 주체가 특정 태그 키를 사용할 수 있는지 여부를 제어합니다. 이 경우 키 값은 중요하지 않습니다.

태그 기만 액세스 제어 정책 예시는 [태그를 기준으로 트랜스크립션 작업 보기](security_iam_id-based-policy-examples.md#tagging-transcription-policy) 섹션을 참조하세요.

태그 기반 액세스 제어에 대한 자세한 내용은 [태그를 사용한 AWS 리소스 액세스 제어](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)를 참조하세요.

## Amazon Transcribe 리소스에 태그 추가
<a name="tagging-how-to"></a>

Amazon Transcribe 작업을 실행하기 전이나 후에 태그를 추가할 수 있습니다. 기존 **Create\$1** 및 **Start\$1** API를 사용하여 트랜스크립션 요청에 태그를 추가할 수 있습니다.

**AWS Management Console**, **AWS CLI** 또는 **AWS SDK**를 사용하여 태그를 추가, 수정 또는 삭제할 수 있습니다, 다음의 예시를 참조하세요.

### AWS Management Console
<a name="tagging-console"></a>

1. 에 로그인합니다..[AWS Management Console](https://console.aws.amazon.com/transcribe/)

1. 탐색 창에서 **트랜스크립션 작업**을 선택한 다음 **작업 생성**(오른쪽 상단)을 선택합니다. 그러면 **작업 세부 정보 지정** 페이지가 열립니다.

1. **작업 세부 정보 지정** 페이지 하단으로 스크롤하여 **태그 - *선택 사항*** 상자를 찾은 다음 **새 태그 추가**를 선택합니다.  
![\[Amazon Transcribe 콘솔 스크린샷: '작업 세부 정보 지정' 페이지.\]](http://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/images/add-new-tag.png)

1. **키** 필드 및 **값** 필드(선택 사항)에 대한 정보를 입력합니다.  
![\[Amazon Transcribe 콘솔 스크린샷: 예시 태그를 보여주는 '태그' 패널.\]](http://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/images/add-new-tag-color.png)

1. **작업 세부 정보 지정** 페이지에 포함하려는 다른 필드를 모두 채운 후 **다음**을 선택합니다. 그러면 **작업 구성 - *선택 사항* 페이지**로 이동합니다.

   **작업 생성**을 선택하여 트랜스크립션 작업을 실행합니다.

1. **트랜스크립션 작업** 페이지로 이동하여 트랜스크립션 작업을 선택한 다음 해당 작업의 정보 페이지 하단으로 스크롤하면 트랜스크립션 작업과 관련된 태그를 볼 수 있습니다. 태그를 편집하려는 경우 **태그 관리**를 선택하면 됩니다.  
![\[Amazon Transcribe 콘솔 스크린샷: 트랜스크립션 작업 정보 페이지의 '태그' 패널.\]](http://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/images/view-tags.png)

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

이 예시에서는 [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html) 명령 및 `Tags` 파라미터를 사용합니다. 자세한 내용은 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) 및 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Tag.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Tag.html)을(를) 참조하세요.

```
aws transcribe start-transcription-job \
--region us-west-2 \
--transcription-job-name my-first-transcription-job \
--media MediaFileUri=s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac \
--output-bucket-name amzn-s3-demo-bucket \
--output-key my-output-files/ \
--language-code en-US \
--tags Key=color,Value=blue Key=shape,Value=square
```

다음은 [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html) 명령을 사용하는 또 다른 예 및 해당 작업에 태그를 추가하는 요청 본문입니다.

```
aws transcribe start-transcription-job \
--region us-west-2 \
--cli-input-json file://filepath/my-first-tagging-job.json
```

*my-first-tagging-job.json* 파일에는 다음과 같은 요청 본문이 포함되어 있습니다.

```
{
  "TranscriptionJobName": "my-first-transcription-job",
  "Media": {
        "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
  },
  "OutputBucketName": "amzn-s3-demo-bucket",
  "OutputKey": "my-output-files/", 
  "LanguageCode": "en-US",
  "Tags": [ 
        {
           "Key": "color",
           "Value": "blue"
        },
        {
           "Key": "shape",
           "Value": "square"
        }
  ]
}
```

### AWS SDK for Python (Boto3)
<a name="tagging-python-batch"></a>

다음 예시에서는 AWS SDK for Python (Boto3)를 통해 [start\$1transcription\$1job](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.start_transcription_job) 메서드의 `Tags` 인수를 사용하여 태그를 추가합니다. 자세한 내용은 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) 및 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Tag.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Tag.html)을(를) 참조하세요.

기능별, 시나리오 및 교차 서비스 예를 포함하여 AWS SDK를 사용하는 추가 예시는 [AWS SDKs를 사용한 Amazon Transcribe의 코드 예제](service_code_examples.md) 장을 참조하세요.

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-transcription-job"
job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
transcribe.start_transcription_job(
    TranscriptionJobName = job_name,
    Media = {
        'MediaFileUri': job_uri
    },
    OutputBucketName = 'amzn-s3-demo-bucket',
    OutputKey = 'my-output-files/', 
    LanguageCode = 'en-US', 
    Tags = [
        {
            'Key':'color', 
            'Value':'blue'
        }
    ]
)

while True:
    status = transcribe.get_transcription_job(TranscriptionJobName = job_name)
    if status['TranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```