Resource: aws_timestreamwrite_table

Provides a Timestream table resource.

Example Usage

Basic usage

resource "aws_timestreamwrite_table" "example" {
  database_name = aws_timestreamwrite_database.example.database_name
  table_name    = "example"
}

Full usage

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"
  }
}

Customer-defined Partition Key

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"
    }
  }
}

Argument Reference

This resource supports the following arguments:

Magnetic Store Write Properties

The magnetic_store_write_properties block supports the following arguments:

Magnetic Store Rejected Data Location

The magnetic_store_rejected_data_location block supports the following arguments:

S3 Configuration

The s3_configuration block supports the following arguments:

Retention Properties

The retention_properties block supports the following arguments:

Schema

The schema block supports the following arguments:

Composite Partition Key

The composite_partition_key block supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

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