AWS::Config::StoredQuery - AWS CloudFormation

AWS::Config::StoredQuery

Saves a new query or updates an existing saved query. The QueryName must be unique for a single AWS account and a single AWS Region. You can create upto 300 queries in a single AWS account and a single AWS Region.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Config::StoredQuery", "Properties" : { "QueryDescription" : String, "QueryExpression" : String, "QueryName" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::Config::StoredQuery Properties: QueryDescription: String QueryExpression: String QueryName: String Tags: - Tag

Properties

QueryDescription

A unique description for the query.

Required: No

Type: String

Update requires: No interruption

QueryExpression

The expression of the query. For example, SELECT resourceId, resourceType, supplementaryConfiguration.BucketVersioningConfiguration.status WHERE resourceType = 'AWS::S3::Bucket' AND supplementaryConfiguration.BucketVersioningConfiguration.status = 'Off'.

Required: Yes

Type: String

Update requires: No interruption

QueryName

The name of the query.

Required: Yes

Type: String

Minimum: 1

Maximum: 64

Pattern: ^[a-zA-Z0-9-_]+$

Update requires: Replacement

Tags

An array of tag object.

Required: No

Type: List of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the stored query.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

QueryArn

Amazon Resource Name (ARN) of the query. For example, arn:partition:service:region:account-id:resource-type/resource-name/resource-id.

QueryId

The ID of the query.

Examples

StoredQuery

The following example saves a stored query

JSON

"StoredQuery": { "Type": "AWS::Config::StoredQuery", "Properties": { "QueryName": "SampleStoredQuery", "QueryExpression": "SELECT *", "QueryDescription": "A sample query", "Tags": [ { "Key": "TagKey", "Value": "TagValue" } ] } }

YAML

StoredQuery: Type: AWS::Config::StoredQuery Properties: QueryName: SampleStoredQuery QueryExpression: "SELECT *" QueryDescription: "A sample query" Tags: - Key: "TagKey" Value: "TagValue"