hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Enhancement]: Support Timestream for InfluxDB #36398

Open sentros opened 3 months ago

sentros commented 3 months ago

Description

It's now possible to select a different engine for a Timestream database in the aws console. The previous engine is now called LiveAnalytics and a new engine was added called InfluxDB. Terraform has no support for the InfluxDB engine or for its configuration options.

If you plan to add the new engine as an option to the pre existing aws_timestreamwrite_database you could just add new parameters for it as shown in the example. At least the parameter group needs its own new resource.

Not much is shared between the engines so maybe a whole new resource for InfluxDB type Timestream would be better. For example the RDS resource handles engine types all in the same resource but RDS engine types at least share some configuration options between them as opposed to Timestream for LiveAnalytics vs InfluxDB.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_timestreamwrite_database" "example" {
  database_name = "database-example"
  engine        = "influxdb"

  db_name           = "db-name-example"
  username          = "example-username"
  password          = "example-password"
  organization_name = "example-org"
  bucket_name       = "example-bucket"

  instance_class    = "db.influx.medium"
  storage_type      = "included-3000"
  allocated_storage = 200
  multi_az          = true

  db_subnet_group_name   = aws_db_subnet_group.example.name
  vpc_security_group_ids = [aws_security_group.example.id]
  publicly_accessible    = false

  parameter_group_name = aws_timestreamwrite_parametergroup.example.name
  s3_logs_location     = aws_s3_bucket.example.id

  tags = {
    Name = "value"
  }
}

resource "aws_timestreamwrite_parametergroup" "example" {
  name        = "example-name"
  description = "example-description"

  parameter {
    name  = "flux-log-enabled"
    value = "TRUE"
  }

  parameter {
    name  = "log-level"
    value = "error"
  }

  tags = {
    Name = "value"
  }

}

References

Would you like to implement a fix?

None

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

ewbankkit commented 3 months ago

At the API level Timestream for InfluxDB is a distinct service. Following our naming guidelines the first resource should be:

resource "aws_timestreaminfluxdb_db_instance" "example" {
  name = "..."
}
trevorbonas commented 1 month ago

I would like to work on this issue.

trevorbonas commented 1 month ago

I am working on the aws_timestreaminfluxdb_db_instance resource and will provide updates in the coming weeks.

So far, my implementation differs in a few ways from the proposed implementation.