awswrangler.timestream.create_table¶
- awswrangler.timestream.create_table(database: str, table: str, memory_retention_hours: int, magnetic_retention_days: int, tags: dict[str, str] | None = None, timestream_additional_kwargs: dict[str, Any] | None = None, boto3_session: Session | None = None) str ¶
Create a new Timestream database.
Note
If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account.
- Parameters:
database (
str
) – Database name.table (
str
) – Table name.memory_retention_hours (
int
) – The duration for which data must be stored in the memory store.magnetic_retention_days (
int
) – The duration for which data must be stored in the magnetic store.tags (
dict
[str
,str
] |None
) – Key/Value dict to put on the table. Tags enable you to categorize databases and/or tables, for example, by purpose, owner, or environment. e.g. {“foo”: “boo”, “bar”: “xoo”})timestream_additional_kwargs (
dict
[str
,Any
] |None
) – Forwarded to botocore requests. e.g. timestream_additional_kwargs={‘MagneticStoreWriteProperties’: {‘EnableMagneticStoreWrites’: True}}boto3_session (
Session
|None
) – The default boto3 session will be used if boto3_session isNone
.
- Return type:
str
- Returns:
The Amazon Resource Name that uniquely identifies this database. (ARN)
Examples
Creating a table.
>>> import awswrangler as wr >>> arn = wr.timestream.create_table( ... database="MyDatabase", ... table="MyTable", ... memory_retention_hours=3, ... magnetic_retention_days=7 ... )