timescale/terraform-provider-timescale

Feature request: ability to set up VPC peering through the provider

Closed this issue ยท 3 comments

Currently, to leverage VPC peering for Timescale instances, the follows steps need to be taken:

  1. Create a VPC in Timescale
  2. Create a Peering Connection
  3. Complete the peering process in AWS
  4. Confirm the Peering Connection is showing as 'Connected' (green) in the Timescale VPC UI

A significant improvement would be the ability to carry out the peering process through the provider itself rather than having to do it manually.

This is one of the main features holding our team back from using this terraform provider at this point. We'd love to see it added!

It's also the next feature we want to add. Thank you for your interest, it'll help us prioritize ๐Ÿ˜‰

Version v1.9.0 gives all pcx / vpc ids so that it can be peered through terraform , for example

resource "timescale_vpcs" "vpc" { 
  cidr                = "10.10.10.10/16"
  name                = "vpc_name"
  region_code         = ${AWS_REGION}
}

resource "aws_vpc" "vpc" {
  cidr_block = "11.11.11.11/24"
}

resource "timescale_peering_connection" "pc" { 
  peer_account_id  = ${AWS_ACC_ID}
  peer_region_code = ${AWS_REGION}
  peer_vpc_id      = aws_vpc.main.id
  timescale_vpc_id = timescale_vpcs.full.id
}

resource "aws_vpc_peering_connection" "pc" {
  peer_vpc_id = aws_vpc.vpc.id
  vpc_id = timescale_vpcs.vpc.provisioned_id
  auto_accept   = true
}

import {
  to = aws_vpc_peering_connection.pc
  **id = "pcx-..."**
}

Where pcx value will be available in timescale_peering_connection.pc.provisioned_id after a refresh
Sadly I don't think we can import putting a variable as ID so there's a manual step for now, looking into how to make this frictionless.