

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Mengelola tag menggunakan CLI atau API
<a name="tag-resources-api-sdk"></a>

Gunakan AWS CLI perintah atau operasi AWS Batch API berikut untuk menambahkan, memperbarui, membuat daftar, dan menghapus tag untuk sumber daya Anda.


**Dukungan tag untuk AWS Batch sumber daya**  

| Tugas | Tindakan API | AWS CLI | AWS Tools for Windows PowerShell | 
| --- | --- | --- | --- | 
| Tambahkan atau timpa satu atau beberapa tanda. | [TagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html) | [tag-sumber daya](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) | 
| Hapus satu atau beberapa tanda. | [UntagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html) | [untag-sumber daya](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) | 
| Membuat daftar tanda untuk sumber daya | [ListTagsForResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_ListTagsForResource.html) | [daftar-tag-untuk-sumber daya](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) | 

Contoh-contoh berikut menunjukkan cara menambahkan atau menghilangkan tanda sumber daya menggunakan AWS CLI.

**Contoh 1: Menandai sumber daya yang sudah ada**  
Perintah berikut ini menandai sumber daya yang sudah ada.

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

**Contoh 2: Menghapus tanda sumber daya yang sudah ada**  
Perintah berikut ini menghapus tanda dari sumber daya yang sudah ada.

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

**Contoh 3: Cantumkan tanda untuk sumber daya**  
Perintah berikut akan mencantumkan tanda terkait dengan sumber daya yang sudah ada.

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

Beberapa tindakan pembuatan sumber daya memungkinkan Anda untuk menentukan tanda saat membuat sumber daya. Tindakan berikut mendukung pemberian tag saat pembuatan.


| Tugas | Tindakan API | AWS CLI | AWS Tools for Windows PowerShell | 
| --- | --- | --- | --- | 
| Membuat lingkungan komputasi | [CreateComputeEnvironment](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateComputeEnvironment.html) | [buat-komputasi-lingkungan](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) | 
| Membuat antrean tugas | [CreateJobQueue](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateJobQueue.html) | [buat-pekerjaan-antrian](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) | 
| Buat kebijakan penjadwalan | [CreateSchedulingPolicy](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateSchedulingPolicy.html) | [buat-penjadwalan-kebijakan](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) | 
| Mendaftarkan ketentuan tugas | [RegisterJobDefinition](https://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html) | [daftar-pekerjaan-definisi](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) | 
| Mengirim tugas | [SubmitJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html) | [kirimkan pekerjaan](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) | 
| Buat sumber daya habis pakai | [CreateConsumableResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateConsumableResource.html) | [buat-sumber daya habis-habis](https://docs.aws.amazon.com/cli/latest/reference/batch/create-consumable-resource.html) | [New-BATConsumableResource](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATConsumableResource.html) | 
| Ciptakan lingkungan layanan | [CreateServiceEnvironment](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateServiceEnvironment.html) | [menciptakan-layanan-lingkungan](https://docs.aws.amazon.com/cli/latest/reference/batch/create-service-environment.html) | [New-BATServiceEnvironment](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATServiceEnvironment.html) | 
| Buat pembagian kuota | [CreateQuotaShare](https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateQuotaShare.html) | [buat-kuota-bagikan](https://docs.aws.amazon.com/cli/latest/reference/batch/create-quota-share.html) | [New-BATQuotaShare](https://docs.aws.amazon.com/powershell/latest/reference/items/New-BATQuotaShare.html) | 