Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/com.pulumi/aws@7.16.x

docs

common-patterns.mdgetting-started.mdindex.mdprovider.md
tile.json

tessl/maven-com-pulumi--aws

tessl install tessl/maven-com-pulumi--aws@7.16.0

Pulumi Java SDK for AWS providing strongly-typed Infrastructure-as-Code for 227 AWS service packages including compute, storage, databases, networking, security, analytics, machine learning, and more.

timestream.mddocs/services/databases/

Amazon Timestream

Amazon Timestream is a fast, scalable, and serverless time-series database service for IoT and operational applications.

Package Information

  • Package: com.pulumi.aws.timestreamwrite (for write operations)
  • Package: com.pulumi.aws.timestreamquery (for query operations)
  • Common Resources: Database, Table

Key Resources

Database

Creates a Timestream database.

import com.pulumi.aws.timestreamwrite.Database;
import com.pulumi.aws.timestreamwrite.DatabaseArgs;

var database = new Database("metrics-db", DatabaseArgs.builder()
    .databaseName("metrics-database")
    .kmsKeyId(kmsKey.arn())
    .tags(Map.of(
        "Environment", "production"
    ))
    .build());

Table

Creates a Timestream table within a database.

import com.pulumi.aws.timestreamwrite.Table;
import com.pulumi.aws.timestreamwrite.TableArgs;
import com.pulumi.aws.timestreamwrite.inputs.TableRetentionPropertiesArgs;
import com.pulumi.aws.timestreamwrite.inputs.TableMagneticStoreWritePropertiesArgs;

var table = new Table("metrics-table", TableArgs.builder()
    .databaseName(database.databaseName())
    .tableName("sensor-metrics")
    .retentionProperties(TableRetentionPropertiesArgs.builder()
        .magneticStoreRetentionPeriodInDays(365)
        .memoryStoreRetentionPeriodInHours(24)
        .build())
    .magneticStoreWriteProperties(TableMagneticStoreWritePropertiesArgs.builder()
        .enableMagneticStoreWrites(true)
        .build())
    .tags(Map.of(
        "Application", "IoT"
    ))
    .build());

Common Patterns

Database with Multi-Region Replication

var database = new Database("replicated-db", DatabaseArgs.builder()
    .databaseName("replicated-database")
    .kmsKeyId(kmsKey.arn())
    .build());

Table with Custom Retention

var table = new Table("custom-retention-table", TableArgs.builder()
    .databaseName(database.databaseName())
    .tableName("custom-metrics")
    .retentionProperties(TableRetentionPropertiesArgs.builder()
        .magneticStoreRetentionPeriodInDays(730)  // 2 years
        .memoryStoreRetentionPeriodInHours(168)   // 7 days
        .build())
    .build());

Query Existing Database

import com.pulumi.aws.timestreamwrite.TimestreamwriteFunctions;
import com.pulumi.aws.timestreamwrite.inputs.GetDatabaseArgs;

var dbData = TimestreamwriteFunctions.getDatabase(GetDatabaseArgs.builder()
    .name("metrics-database")
    .build());

Key Properties

Database Properties

  • databaseName - Name of the database
  • kmsKeyId - KMS key ARN for encryption
  • tags - Resource tags

Table Properties

  • databaseName - Name of the parent database
  • tableName - Name of the table
  • retentionProperties - Data retention configuration
    • memoryStoreRetentionPeriodInHours - Memory store retention (1-8766 hours)
    • magneticStoreRetentionPeriodInDays - Magnetic store retention (1-73000 days)
  • magneticStoreWriteProperties - Magnetic store write configuration
  • tags - Resource tags

Output Properties

  • id - Resource ID
  • arn - ARN of the database/table
  • creationTime - Creation timestamp

Use Cases

  • IoT Data: Store and analyze sensor data and device metrics
  • Application Metrics: Monitor application performance over time
  • DevOps Monitoring: Track infrastructure and service metrics
  • Industrial Telemetry: Collect and analyze industrial equipment data
  • Financial Market Data: Store tick data and market metrics
  • Fleet Management: Track vehicle telemetry and location data

Performance Considerations

  • Memory Store: Fast storage for recent data (up to 366 days)
  • Magnetic Store: Cost-effective storage for historical data
  • Adaptive Query Processing: Automatically optimizes query execution
  • Multi-Measure Records: Store multiple measurements in a single record

Related Services

  • CloudWatch - Monitoring and observability
  • Kinesis - Real-time data streaming
  • DynamoDB - NoSQL database
  • RDS - Relational database service