timescale / terraform-provider-timescale

Timescale Cloud Terraform Provider
Apache License 2.0
18 stars 2 forks source link

Bug: timescale_peering_connection cannot be imported #207

Open mattk-ce opened 2 weeks ago

mattk-ce commented 2 weeks ago

Docs say "Import can be done with timescale_vpc_id,peer_account_id,peer_region_code,peer_vpc_id format", but it does not work.

With the following import block (real IDs replaced by same-length and format random IDs):

import {
  to = timescale_peering_connection.pc
  id = "vpc-12345677890123450,123456789012,us-east-1,vpc-98765432109876543"
}

I receive

Error: Parse Error

│ could not parse peering connection ID

In looking at the code, based on this line, it seems that it might be expecting the first parameter to actually be an integer. But even if it managed to parse that, it doesn't seem to ever do anything with it other than output diagnostics. Is it safe to say importing this rather critical resource is non-functional?

mattk-ce commented 2 weeks ago

Ah, I figured it out. It looks like it expects an internal ID rather than the AWS VPC ID. I think it would be helpful to explain this in the docs, or make it more obvious with the naming of the format string, something like:

"Import can be done with timescale_internal_vpc_id,peer_account_id,peer_region_code,peer_aws_vpc_id format"

Also, the only reason I knew the internal ID of the VPC was because I also imported the VPC resource and was able to see it in the resource's properties. The Timescale control plane UI doesn't expose this ID anywhere, at least nowhere that I could find.

EDIT - reopened issue for visibility on documentation issue.

Khyme commented 2 weeks ago

Thank you for your feedback @mattk-ce , will update to make it clearer.