Carova
Serverless AWS Create Timestream Database and Table
Create an AWS Timestream Database and Table in your Serverless YAML file. AWS Timestream is for IoT events and any data that needs to be tied to a specific point in time.
Add the following to the resources section of your Serverless YAML file:
1resources:
2 Resources:
3 TimestreamDatabaseName:
4 Type: AWS::Timestream::Database
5 Properties:
6 DatabaseName: ${self:service}-${opt:stage, self:provider.stage}-timestream
7
8 TimestreamTableName:
9 Type: AWS::Timestream::Table
10 DependsOn:
11 - TimestreamDatabaseName
12 Properties:
13 DatabaseName: { Ref: TimestreamDatabaseName }
14 TableName: ${self:service}-${opt:stage, self:provider.stage}-timestream-table
15 MagneticStoreWriteProperties:
16 EnableMagneticStoreWrites: true
17 RetentionProperties:
18 MemoryStoreRetentionPeriodInHours: 24
19 MagneticStoreRetentionPeriodInDays: 3650