Tag Resource
ecs_tag_resource | R Documentation |
Associates the specified tags to a resource with the specified resourceArn¶
Description¶
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.
Usage¶
ecs_tag_resource(resourceArn, tags)
Arguments¶
resourceArn |
[required] The Amazon Resource Name (ARN) of the resource to add tags to. Currently, the supported resources are Amazon ECS capacity providers, tasks, services, task definitions, clusters, and container instances. In order to tag a service that has the following ARN format, you need to migrate the service to the long ARN. For more information, see Migrate an Amazon ECS short service ARN to a long ARN in the Amazon Elastic Container Service Developer Guide.
After the migration is complete, the service has the long ARN format, as shown below. Use this ARN to tag the service.
If you try to tag a service with a short ARN, you receive an
|
tags |
[required] The tags to add to the resource. A tag is an array of key-value pairs. The following basic restrictions apply to tags:
|
Value¶
An empty list.
Request syntax¶
svc$tag_resource(
resourceArn = "string",
tags = list(
list(
key = "string",
value = "string"
)
)
)
Examples¶
## Not run:
# This example tags the 'dev' cluster with key 'team' and value 'dev'.
svc$tag_resource(
resourceArn = "arn:aws:ecs:region:aws_account_id:cluster/dev",
tags = list(
list(
key = "team",
value = "dev"
)
)
)
## End(Not run)