Skip to main content

stored_queries

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

Overview

Namestored_queries
TypeResource
Idaws.config.stored_queries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringA unique description for the query. (pattern: <code>[\s\S]*</code>)
expressionstringThe expression of the query. For example, SELECT resourceId, resourceType, supplementaryConfiguration.BucketVersioningConfiguration.status WHERE resourceType = 'AWS::S3::Bucket' AND supplementaryConfiguration.BucketVersioningConfiguration.status = 'Off'. (pattern: <code>[\s\S]*</code>)
query_arnstringAmazon Resource Name (ARN) of the query. For example, arn:partition:service:region:account-id:resource-type/resource-name/resource-id. (pattern: <code>^arn:aws[a-z-]*:config:[a-z-\d]+:\d+:stored-query/[a-zA-Z0-9-]+/query-[a-zA-Z\d-/]+$</code>)
query_idstringThe ID of the query. (pattern: <code>^\S+$</code>)
query_namestringThe name of the query. (pattern: <code>^[a-zA-Z0-9-_]+$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_stored_queryselectregionReturns the details of a specific stored query.
list_stored_queriesselectregionLists the stored queries for a single Amazon Web Services account and a single Amazon Web Services Region. The default is 100.
put_stored_queryreplaceregion, StoredQuerySaves a new query or updates an existing saved query. The QueryName must be unique for a single Amazon Web Services account and a single Amazon Web Services Region. You can create upto 300 queries in a single Amazon Web Services account and a single Amazon Web Services Region. Tags are added at creation and cannot be updated PutStoredQuery is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different tags values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, tags will not be updated, even if they are different.
delete_stored_querydeleteregionDeletes the stored query for a single Amazon Web Services account and a single Amazon Web Services Region.

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)

SELECT examples

Returns the details of a specific stored query.

SELECT
description,
expression,
query_arn,
query_id,
query_name
FROM aws.config.stored_queries
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Saves a new query or updates an existing saved query. The QueryName must be unique for a single Amazon Web Services account and a single Amazon Web Services Region. You can create upto 300 queries in a single Amazon Web Services account and a single Amazon Web Services Region. Tags are added at creation and cannot be updated PutStoredQuery is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different tags values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, tags will not be updated, even if they are different.

REPLACE aws.config.stored_queries
SET
StoredQuery = '{{ StoredQuery }}',
Tags = '{{ Tags }}'
WHERE
region = '{{ region }}' --required
AND StoredQuery = '{{ StoredQuery }}' --required
RETURNING
query_arn;

DELETE examples

Deletes the stored query for a single Amazon Web Services account and a single Amazon Web Services Region.

DELETE FROM aws.config.stored_queries
WHERE region = '{{ region }}' --required
;