Skip to main content

tags

Creates, updates, deletes, gets or lists a tags resource.

Overview

Nametags
TypeResource
Idaws.mgn.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
tagsobjectList tags for resource response.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectresource_arn, regionList all tags for your Application Migration Service resources.
tag_resourceupdateresource_arn, region, tagsAdds or overwrites only the specified tags for the specified Application Migration Service resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value.
untag_resourceupdateresource_arn, tagKeys, regionDeletes the specified set of tags from the specified set of Application Migration Service resources.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
resource_arnstringUntag resource by ARN.
tagKeysarrayUntag resource by Keys.

SELECT examples

List all tags for your Application Migration Service resources.

SELECT
tags
FROM aws.mgn.tags
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Adds or overwrites only the specified tags for the specified Application Migration Service resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value.

UPDATE aws.mgn.tags
SET
tags = '{{ tags }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
AND tags = '{{ tags }}' --required;