AWS Amazon Timestream Database
This page shows how to write Terraform and CloudFormation for Amazon Timestream Database and write them securely.
aws_timestreamwrite_database (Terraform)
The Database in Amazon Timestream can be configured in Terraform with the resource name aws_timestreamwrite_database
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_timestreamwrite_database" "enabled" {
database_name = "timestream"
kms_key_id = var.kms_key_id
}
resource "aws_timestreamwrite_database" "enabled" {
database_name = "timestream"
kms_key_id = var.kms_key_id
}
resource "aws_timestreamwrite_database" "test" {
database_name = "examplea"
kms_key_id = aws_kms_key.test.arn
resource "aws_timestreamwrite_database" "tulsi-ts" {
database_name = "tulsi"
tags = {
Name = "tulsi-ts"
}
resource "aws_timestreamwrite_database" "example" {
database_name = "database-example"
kms_key_id = aws_kms_key.example.arn
tags = {
Name = "value"
Parameters
The following arguments are supported:
database_name
– (Required) The name of the Timestream database. Minimum length of 3. Maximum length of 64.kms_key_id
- (Optional) The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.tags
- (Optional) Map of tags to assign to this resource. If configured with a providerdefault_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
In addition to all arguments above, the following attributes are exported:
id
- The name of the Timestream database.arn
- The ARN that uniquely identifies this database.kms_key_id
- The ARN of the KMS key used to encrypt the data stored in the database.table_count
- The total number of tables found within the Timestream database.tags_all
- A map of tags assigned to the resource, including those inherited from the providerdefault_tags
configuration block.
Explanation in Terraform Registry
Provides a Timestream database resource.
AWS::Timestream::Database (CloudFormation)
The Database in Timestream can be configured in CloudFormation with the resource name AWS::Timestream::Database
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: "AWS::Timestream::Database"
Properties:
DatabaseName: CPTMonitoring
timestreamTable:
Type: "AWS::Timestream::Table"
Properties:
Type: AWS::Timestream::Database
Properties:
DatabaseName: timestream
Type: AWS::Timestream::Database
Properties:
DatabaseName: timestream
KmsKeyId: kms-key-id
Type: AWS::Timestream::Database
Properties:
DatabaseName: timestream
KmsKeyId: kms-key-id
Type: AWS::Timestream::Database
Properties:
DatabaseName: timestream
"Type" : "AWS::Timestream::Database"
},
"TimestreamTable": {
"Type" : "AWS::Timestream::Table",
"Properties" : {
"Type" : "AWS::Timestream::Database"
},
"TimestreamTable": {
"Type" : "AWS::Timestream::Table",
"Properties" : {
"Type" : "AWS::Timestream::Database"
},
"TimestreamTable": {
"Type" : "AWS::Timestream::Table",
"Properties" : {
"Type" : "AWS::Timestream::Database"
},
"TimestreamTable": {
"Type" : "AWS::Timestream::Table",
"Properties" : {
"Type": "AWS::Timestream::Database",
"Properties": {
"DatabaseName": "StockData"
}
},
"TimeStreamDBStockDataTable": {
Parameters
-
DatabaseName
optional - String -
KmsKeyId
optional - String -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
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 for more info. Service quotas apply. See code sample for details.
Frequently asked questions
What is AWS Amazon Timestream Database?
AWS Amazon Timestream Database is a resource for Amazon Timestream of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon Timestream Database?
For Terraform, the melscoop-test/check, SnidermanIndustries/checkov-fork and JamesWoolfenden/check-encrypt source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the gkilcaus/cpt-monitoring, SnidermanIndustries/checkov-fork and melscoop-test/check source code examples are useful. See the CloudFormation Example section for further details.