Skip to main content

tags

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

Overview

Nametags
TypeResource
Idaws.autoscaling.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
keystringThe tag key.
propagate_at_launchbooleanDetermines whether the tag is added to new instances as they are launched in the group.
resource_idstringThe name of the group.
resource_typestringThe type of resource. The only supported value is auto-scaling-group.
valuestringThe tag value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_tagsselectregionFilters, NextToken, MaxRecordsDescribes the specified tags. You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results. You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there's no match, no special message is returned. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
create_or_update_tagsinsertregionTagsCreates or updates tags for the specified Auto Scaling group. When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and you do not get an error message. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
delete_tagsdeleteregionTagsDeletes the specified tags.

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)
FiltersarrayOne or more filters to scope the tags to return. The maximum number of filters per filter type (for example, auto-scaling-group) is 1000.
MaxRecordsintegerThe maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
NextTokenstringThe token for the next set of items to return. (You received this token from a previous call.)
TagsarrayOne or more tags.

SELECT examples

Describes the specified tags. You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results. You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there's no match, no special message is returned. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.

SELECT
key,
propagate_at_launch,
resource_id,
resource_type,
value
FROM aws.autoscaling.tags
WHERE region = '{{ region }}' -- required
AND Filters = '{{ Filters }}'
AND NextToken = '{{ NextToken }}'
AND MaxRecords = '{{ MaxRecords }}'
;

INSERT examples

Creates or updates tags for the specified Auto Scaling group. When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and you do not get an error message. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.

INSERT INTO aws.autoscaling.tags (
region,
Tags
)
SELECT
'{{ region }}',
'{{ Tags }}'
;

DELETE examples

Deletes the specified tags.

DELETE FROM aws.autoscaling.tags
WHERE region = '{{ region }}' --required
AND Tags = '{{ Tags }}'
;