Provides a Timestream table resource.
resource "aws_timestreamwrite_table" "example" {
database_name = aws_timestreamwrite_database.example.database_name
table_name = "example"
}
resource "aws_timestreamwrite_table" "example" {
database_name = aws_timestreamwrite_database.example.database_name
table_name = "example"
retention_properties {
magnetic_store_retention_period_in_days = 30
memory_store_retention_period_in_hours = 8
}
tags = {
Name = "example-timestream-table"
}
}
resource "aws_timestreamwrite_table" "example" {
database_name = aws_timestreamwrite_database.example.database_name
table_name = "example"
schema {
composite_partition_key {
enforcement_in_record = "REQUIRED"
name = "attr1"
type = "DIMENSION"
}
}
}
This resource supports the following arguments:
database_name
– (Required) The name of the Timestream database.magnetic_store_write_properties
- (Optional) Contains properties to set on the table when enabling magnetic store writes. See Magnetic Store Write Properties below for more details.retention_properties
- (Optional) The retention duration for the memory store and magnetic store. See Retention Properties below for more details. If not provided, magnetic_store_retention_period_in_days
default to 73000 and memory_store_retention_period_in_hours
defaults to 6.schema
- (Optional) The schema of the table. See Schema below for more details.table_name
- (Required) The name of the Timestream table.tags
- (Optional) Map of tags to assign to this resource. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.The magnetic_store_write_properties
block supports the following arguments:
enable_magnetic_store_writes
- (Required) A flag to enable magnetic store writes.magnetic_store_rejected_data_location
- (Optional) The location to write error reports for records rejected asynchronously during magnetic store writes. See Magnetic Store Rejected Data Location below for more details.The magnetic_store_rejected_data_location
block supports the following arguments:
s3_configuration
- (Optional) Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes. See S3 Configuration below for more details.The s3_configuration
block supports the following arguments:
bucket_name
- (Optional) Bucket name of the customer S3 bucket.encryption_option
- (Optional) Encryption option for the customer s3 location. Options are S3 server side encryption with an S3-managed key or KMS managed key. Valid values are SSE_KMS
and SSE_S3
.kms_key_id
- (Optional) KMS key arn for the customer s3 location when encrypting with a KMS managed key.object_key_prefix
- (Optional) Object key prefix for the customer S3 location.The retention_properties
block supports the following arguments:
magnetic_store_retention_period_in_days
- (Required) The duration for which data must be stored in the magnetic store. Minimum value of 1. Maximum value of 73000.memory_store_retention_period_in_hours
- (Required) The duration for which data must be stored in the memory store. Minimum value of 1. Maximum value of 8766.The schema
block supports the following arguments:
composite_partition_key
- (Required) A non-empty list of partition keys defining the attributes used to partition the table data. The order of the list determines the partition hierarchy. The name and type of each partition key as well as the partition key order cannot be changed after the table is created. However, the enforcement level of each partition key can be changed. See Composite Partition Key below for more details.The composite_partition_key
block supports the following arguments:
enforcement_in_record
- (Optional) The level of enforcement for the specification of a dimension key in ingested records. Valid values: REQUIRED
, OPTIONAL
.name
- (Optional) The name of the attribute used for a dimension key.type
- (Required) The type of the partition key. Valid values: DIMENSION
, MEASURE
.This resource exports the following attributes in addition to the arguments above:
id
- The table_name
and database_name
separated by a colon (:
).arn
- The ARN that uniquely identifies this table.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import Timestream tables using the table_name
and database_name
separate by a colon (:
). For example:
import {
to = aws_timestreamwrite_table.example
id = "ExampleTable:ExampleDatabase"
}
Using terraform import
, import Timestream tables using the table_name
and database_name
separate by a colon (:
). For example:
% terraform import aws_timestreamwrite_table.example ExampleTable:ExampleDatabase