Skip to main content

stored_queries

Creates, updates, deletes or gets a stored_query resource or lists stored_queries in a region

Overview

Namestored_queries
TypeResource
DescriptionResource Type definition for AWS::Config::StoredQuery
Idaws.config.stored_queries

Fields

NameDatatypeDescription
query_arnstring
query_idstring
query_namestring
query_descriptionstring
query_expressionstring
tagsarrayThe tags for the stored query.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTQueryName, QueryExpression, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all stored_queries in a region.

SELECT
region,
query_arn,
query_id,
query_name,
query_description,
query_expression,
tags
FROM aws.config.stored_queries
WHERE region = 'us-east-1';

Gets all properties from an individual stored_query.

SELECT
region,
query_arn,
query_id,
query_name,
query_description,
query_expression,
tags
FROM aws.config.stored_queries
WHERE region = 'us-east-1' AND data__Identifier = '<QueryName>';

INSERT example

Use the following StackQL query and manifest file to create a new stored_query resource, using stack-deploy.

/*+ create */
INSERT INTO aws.config.stored_queries (
QueryName,
QueryExpression,
region
)
SELECT
'{{ QueryName }}',
'{{ QueryExpression }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.config.stored_queries
WHERE data__Identifier = '<QueryName>'
AND region = 'us-east-1';

Permissions

To operate on the stored_queries resource, the following permissions are required:

Create

config:PutStoredQuery,
config:GetStoredQuery,
config:TagResource

Read

config:GetStoredQuery,
config:ListTagsForResource

Update

config:PutStoredQuery,
config:GetStoredQuery,
config:TagResource,
config:UntagResource,
config:ListTagsForResource

Delete

config:DeleteStoredQuery,
config:UntagResource

List

config:ListStoredQueries