Skip to main content

tags

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

Overview

Nametags
TypeResource
Idaws.codeguru_security.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
tagsobjectAn 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:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectresource_arn, regionReturns a list of all tags associated with a scan.
tag_resourceupdateresource_arn, region, tagsUse to add one or more tags to an existing scan.
untag_resourceupdateresource_arn, tagKeys, regionUse 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
resource_arnstringThe ARN of the ScanName object. You can retrieve this ARN by calling CreateScan, ListScans, or GetScan.
tagKeysarrayA list of keys for each tag you want to remove from a scan.

SELECT examples

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

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;