tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.codeguru_security.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 existing scan. A tag is a custom attribute label with two parts: A tag key. For example, CostCenter, Environment, or Secret. Tag keys are case sensitive. An optional tag value field. For example, 111122223333, Production, or a team name. Omitting the tag value is the same as using an empty string. 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 a list of all tags associated with a scan. | |
tag_resource | update | resource_arn, region, tags | Use to add one or more tags to an existing scan. | |
untag_resource | update | resource_arn, tagKeys, region | Use to remove one or more tags from an existing scan. |
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 ARN of the ScanName object. You can retrieve this ARN by calling CreateScan, ListScans, or GetScan. |
tagKeys | array | A list of keys for each tag you want to remove from a scan. |
SELECT examples
- list_tags_for_resource
Returns a list of all tags associated with a scan.
SELECT
tags
FROM aws.codeguru_security.tags
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- tag_resource
- untag_resource
Use to add one or more tags to an existing scan.
UPDATE aws.codeguru_security.tags
SET
tags = '{{ tags }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
AND tags = '{{ tags }}' --required;
Use to remove one or more tags from an existing scan.
UPDATE aws.codeguru_security.tags
SET
-- No updatable properties
WHERE
resource_arn = '{{ resource_arn }}' --required
AND tagKeys = '{{ tagKeys }}' --required
AND region = '{{ region }}' --required;