tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.codeguru_reviewer.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
tags | object | An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts: A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive. An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags_for_resource | select | resource_arn, region | Returns the list of tags associated with an associated repository resource. | |
untag_resource | update | resource_arn, tagKeys, region | Removes a tag from an associated repository. | |
tag_resource | update | resource_arn, region | Adds one or more tags to an associated repository. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
resource_arn | string | The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations. |
tagKeys | array | A list of the keys for each tag you want to remove from an associated repository. |
SELECT examples
- list_tags_for_resource
Returns the list of tags associated with an associated repository resource.
SELECT
tags
FROM aws.codeguru_reviewer.tags
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- untag_resource
- tag_resource
Removes a tag from an associated repository.
UPDATE aws.codeguru_reviewer.tags
SET
-- No updatable properties
WHERE
resource_arn = '{{ resource_arn }}' --required
AND tagKeys = '{{ tagKeys }}' --required
AND region = '{{ region }}' --required;
Adds one or more tags to an associated repository.
UPDATE aws.codeguru_reviewer.tags
SET
Tags = '{{ Tags }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required;