

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::Config::StoredQuery
<a name="aws-resource-config-storedquery"></a>

Provides the details of a stored query.

## Syntax
<a name="aws-resource-config-storedquery-syntax"></a>

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

### JSON
<a name="aws-resource-config-storedquery-syntax.json"></a>

```
{
  "Type" : "AWS::Config::StoredQuery",
  "Properties" : {
      "[QueryDescription](#cfn-config-storedquery-querydescription)" : String,
      "[QueryExpression](#cfn-config-storedquery-queryexpression)" : String,
      "[QueryName](#cfn-config-storedquery-queryname)" : String,
      "[Tags](#cfn-config-storedquery-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-config-storedquery-syntax.yaml"></a>

```
Type: AWS::Config::StoredQuery
Properties:
  [QueryDescription](#cfn-config-storedquery-querydescription): String
  [QueryExpression](#cfn-config-storedquery-queryexpression): String
  [QueryName](#cfn-config-storedquery-queryname): String
  [Tags](#cfn-config-storedquery-tags): 
    - Tag
```

## Properties
<a name="aws-resource-config-storedquery-properties"></a>

`QueryDescription`  <a name="cfn-config-storedquery-querydescription"></a>
A unique description for the query.  
*Required*: No  
*Type*: String  
*Pattern*: `[\s\S]*`  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`QueryExpression`  <a name="cfn-config-storedquery-queryexpression"></a>
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  
*Pattern*: `[\s\S]*`  
*Minimum*: `1`  
*Maximum*: `4096`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`QueryName`  <a name="cfn-config-storedquery-queryname"></a>
The name of the query.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9-_]+$`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-config-storedquery-tags"></a>
An array of key-value pairs to apply to this resource.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-config-storedquery-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-config-storedquery-return-values"></a>

### Ref
<a name="aws-resource-config-storedquery-return-values-ref"></a>

### Fn::GetAtt
<a name="aws-resource-config-storedquery-return-values-fn--getatt"></a>

#### 
<a name="aws-resource-config-storedquery-return-values-fn--getatt-fn--getatt"></a>

`QueryArn`  <a name="QueryArn-fn::getatt"></a>
Amazon Resource Name (ARN) of the query. For example, arn:partition:service:region:account-id:resource-type/resource-name/resource-id.

`QueryId`  <a name="QueryId-fn::getatt"></a>
The ID of the query.

# AWS::Config::StoredQuery Tag
<a name="aws-properties-config-storedquery-tag"></a>

The tags for the resource. The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

## Syntax
<a name="aws-properties-config-storedquery-tag-syntax"></a>

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

### JSON
<a name="aws-properties-config-storedquery-tag-syntax.json"></a>

```
{
  "[Key](#cfn-config-storedquery-tag-key)" : String,
  "[Value](#cfn-config-storedquery-tag-value)" : String
}
```

### YAML
<a name="aws-properties-config-storedquery-tag-syntax.yaml"></a>

```
  [Key](#cfn-config-storedquery-tag-key): String
  [Value](#cfn-config-storedquery-tag-value): String
```

## Properties
<a name="aws-properties-config-storedquery-tag-properties"></a>

`Key`  <a name="cfn-config-storedquery-tag-key"></a>
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-config-storedquery-tag-value"></a>
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)