

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

# CLI 또는 API를 사용하여 태그 관리
<a name="tag-resources-api-sdk"></a>

다음 AWS CLI 명령 또는 AWS Batch API 작업을 사용하여 리소스에 대한 태그를 추가, 업데이트, 나열 및 삭제합니다.


**AWS Batch 리소스 태그 지원**  

| Task | API 작업 | AWS CLI | AWS Tools for Windows PowerShell | 
| --- | --- | --- | --- | 
| 하나 이상의 태그를 추가하거나 덮어씁니다. | [TagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html) | [ - tag-resource](https://docs.aws.amazon.com/cli/latest/reference/batch/tag-resource.html) | [Add-BATResourceTag](https://docs.aws.amazon.com/powershell/latest/reference/items/Add-BATResourceTag.html) | 
| 하나 이상의 태그를 삭제합니다. | [UntagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html) | [ - untag-resource](https://docs.aws.amazon.com/cli/latest/reference/batch/untag-resource.html) | [Remove-BATResourceTag](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-BATResourceTag.html) | 
| 리소스에 대한 태그를 나열합니다. | [ListTagsForResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_ListTagsForResource.html) | [list-tags-for-resource](https://docs.aws.amazon.com/cli/latest/reference/batch/list-tags-for-resource.html) | [Get-BATResourceTag](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-BATResourceTag.html) | 

다음 예제는 AWS CLI를 사용하여 리소스에 태그를 지정하거나 태그를 제거하는 방법을 보여줍니다.

**예제 1: 기존 리소스에 태그 지정**  
다음 명령은 기존 리소스에 태그를 지정합니다.

```
aws batch tag-resource --resource-arn {{resource_ARN}} --tags {{team}}={{devs}}
```

**예제 2: 기존 리소스에서 태그 제거**  
다음 명령은 기존 리소스에서 태그를 삭제합니다.

```
aws batch untag-resource --resource-arn {{resource_ARN}} --tag-keys {{tag_key}}
```

**예제 3: 리소스의 태그 나열**  
다음 명령은 기존 리소스와 연결된 태그를 나열합니다.

```
aws batch list-tags-for-resource --resource-arn {{resource_ARN}}
```

일부 리소스 생성 작업에서는 리소스를 생성할 때 태그를 지정할 수 있습니다. 다음 태스크는 생성 시 태그 지정을 지원합니다.


| 작업 | API 작업 | AWS CLI | AWS Tools for Windows PowerShell | 
| --- | --- | --- | --- | 
| 컴퓨팅 환경 생성 | [CreateComputeEnvironment](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateComputeEnvironment.html) | [create-compute-environment](https://docs.aws.amazon.com/cli/latest/reference/batch/create-compute-environment.html) | [New-BATComputeEnvironment](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATComputeEnvironment.html) | 
| 작업 대기열 생성 | [CreateJobQueue](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateJobQueue.html) | [create-job-queue](https://docs.aws.amazon.com/cli/latest/reference/batch/create-job-queue.html) | [New-BATJobQueue](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATJobQueue.html) | 
| 예약 정책 생성 | [CreateSchedulingPolicy](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateSchedulingPolicy.html) | [create-scheduling-policy](https://docs.aws.amazon.com/cli/latest/reference/batch/create-scheduling-policy.html) | [New-BATSchedulingPolicy](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATSchedulingPolicy.html) | 
| 작업 정의 등록 | [RegisterJobDefinition](https://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html) | [register-task-definition](https://docs.aws.amazon.com/cli/latest/reference/batch/register-job-definition.html) | [Register-BATJobDefinition](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-BATJobDefinition.html) | 
| 작업 제출 | [SubmitJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html) | [submit-job](https://docs.aws.amazon.com/cli/latest/reference/batch/submit-job.html) | [Submit-BATJob](https://docs.aws.amazon.com/powershell/latest/reference/items/Submit-BATJob.html) | 
| 소모성 리소스 생성 | [CreateConsumableResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateConsumableResource.html) | [create-consumable-resource](https://docs.aws.amazon.com/cli/latest/reference/batch/create-consumable-resource.html) | [Create-BATConsumableResource](https://docs.aws.amazon.com/powershell/latest/reference/items/Create-BATConsumableResource.html) | 