

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::Timestream::Database
<a name="aws-resource-timestream-database"></a>

Creates a new Timestream database. If the AWS KMS key is not specified, the database will be encrypted with a Timestream managed AWS KMS key located in your account. Refer to [AWS managed AWS KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) for more info. [Service quotas apply](https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html). See [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.create-db.html) for details. 

## Syntax
<a name="aws-resource-timestream-database-syntax"></a>

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

### JSON
<a name="aws-resource-timestream-database-syntax.json"></a>

```
{
  "Type" : "AWS::Timestream::Database",
  "Properties" : {
      "[DatabaseName](#cfn-timestream-database-databasename)" : String,
      "[KmsKeyId](#cfn-timestream-database-kmskeyid)" : String,
      "[Tags](#cfn-timestream-database-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-timestream-database-syntax.yaml"></a>

```
Type: AWS::Timestream::Database
Properties:
  [DatabaseName](#cfn-timestream-database-databasename): String
  [KmsKeyId](#cfn-timestream-database-kmskeyid): String
  [Tags](#cfn-timestream-database-tags): 
    - Tag
```

## Properties
<a name="aws-resource-timestream-database-properties"></a>

`DatabaseName`  <a name="cfn-timestream-database-databasename"></a>
The name of the Timestream database.  
*Length Constraints*: Minimum length of 3 bytes. Maximum length of 256 bytes.  
*Required*: No  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9_.-]{3,256}$`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`KmsKeyId`  <a name="cfn-timestream-database-kmskeyid"></a>
The identifier of the AWS KMS key used to encrypt the data stored in the database.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-timestream-database-tags"></a>
The tags to add to the database.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-timestream-database-tag.md)  
*Maximum*: `200`  
*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-timestream-database-return-values"></a>

### Ref
<a name="aws-resource-timestream-database-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the database name `DATABASE_NAME`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

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

The `Fn::GetAtt` returns a value for the specified attribute of this type. The following are the available attributes:

#### 
<a name="aws-resource-timestream-database-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The `arn` of the database.

# AWS::Timestream::Database Tag
<a name="aws-properties-timestream-database-tag"></a>

 A tag is a label that you assign to a Timestream database and/or table. Each tag consists of a key and an optional value, both of which you define. With tags, you can categorize databases and/or tables, for example, by purpose, owner, or environment. 

## Syntax
<a name="aws-properties-timestream-database-tag-syntax"></a>

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

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

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

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

```
  [Key](#cfn-timestream-database-tag-key): String
  [Value](#cfn-timestream-database-tag-value): String
```

## Properties
<a name="aws-properties-timestream-database-tag-properties"></a>

`Key`  <a name="cfn-timestream-database-tag-key"></a>
 The key of the tag. Tag keys are case sensitive.   
*Required*: No  
*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-timestream-database-tag-value"></a>
 The value of the tag. Tag values are case-sensitive and can be null.   
*Required*: No  
*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)