stored_queries
Creates, updates, deletes, gets or lists a stored_queries resource.
Overview
| Name | stored_queries |
| Type | Resource |
| Id | aws.config.stored_queries |
Fields
The following fields are returned by SELECT queries:
- get_stored_query
- list_stored_queries
| Name | Datatype | Description |
|---|---|---|
description | string | A unique description for the query. (pattern: <code>[\s\S]*</code>) |
expression | string | The 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_arn | string | Amazon 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_id | string | The ID of the query. (pattern: <code>^\S+$</code>) |
query_name | string | The name of the query. (pattern: <code>^[a-zA-Z0-9-_]+$</code>) |
| Name | Datatype | Description |
|---|---|---|
next_token | string | If the previous paginated request didn't return all of the remaining results, the response object's NextToken parameter value is set to a token. To retrieve the next set of results, call this operation again and assign that token to the request object's NextToken parameter. If there are no remaining results, the previous response object's NextToken parameter is set to null. |
stored_query_metadata | array | A list of StoredQueryMetadata objects. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_stored_query | select | region | Returns the details of a specific stored query. | |
list_stored_queries | select | region | Lists the stored queries for a single Amazon Web Services account and a single Amazon Web Services Region. The default is 100. | |
put_stored_query | replace | region, StoredQuery | 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. | |
delete_stored_query | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_stored_query
- list_stored_queries
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
;
Lists the stored queries for a single Amazon Web Services account and a single Amazon Web Services Region. The default is 100.
SELECT
next_token,
stored_query_metadata
FROM aws.config.stored_queries
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_stored_query
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
- delete_stored_query
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
;