tagResource

abstract suspend fun tagResource(input: TagResourceRequest): TagResourceResponse

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags that are associated with that resource are deleted as well. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.

Samples


fun main() { 
   //sampleStart 
   // This demonstrates calling the TagResource action.
val resp = batchClient.tagResource {
    resourceArn = "arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1"
    tags = mapOf<String, String>(
        "Stage" to "Alpha"
    )
} 
   //sampleEnd
}