stored_queries
Creates, updates, deletes or gets a stored_query
resource or lists stored_queries
in a region
Overview
Name | stored_queries |
Type | Resource |
Description | Resource Type definition for AWS::Config::StoredQuery |
Id | aws.config.stored_queries |
Fields
Name | Datatype | Description |
---|---|---|
query_arn | string | |
query_id | string | |
query_name | string | |
query_description | string | |
query_expression | string | |
tags | array | The tags for the stored query. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | QueryName, QueryExpression, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.config.stored_queries (
QueryName,
QueryExpression,
region
)
SELECT
'{{ QueryName }}',
'{{ QueryExpression }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.config.stored_queries (
QueryName,
QueryDescription,
QueryExpression,
Tags,
region
)
SELECT
'{{ QueryName }}',
'{{ QueryDescription }}',
'{{ QueryExpression }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: stored_query
props:
- name: QueryName
value: '{{ QueryName }}'
- name: QueryDescription
value: '{{ QueryDescription }}'
- name: QueryExpression
value: '{{ QueryExpression }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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