Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection pooler not working when DB in VPC #151

Open
GabriFila opened this issue Jan 29, 2024 · 6 comments
Open

Connection pooler not working when DB in VPC #151

GabriFila opened this issue Jan 29, 2024 · 6 comments

Comments

@GabriFila
Copy link

Hi!
First of all, thank you for working on this provider 😍
I tried the latest version to test the CRUD of the connection pooler, it works fine except when the DB is in a VPC

The Terraform output is

{
    "connection_pooler_enabled": true,
    "enable_ha_replica": false,
    "hostname": "REDACTED.REDACTED.vpc.tsdb.forge.timescale.com",
    "id": "REDACTED",
    "memory_gb": 2,
    "milli_cpu": 500,
    "name": "REDACTED",
    "password": "REDACTED",
    "pooler_hostname": "",
    "pooler_port": 39454,
    "port": 5432,
    "read_replica_source": null,
    "region_code": "REDACTED",
    "storage_gb": null,
    "timeouts": null,
    "username": "tsdbadmin",
    "vpc_id": "REDACTED"
  }

where the pooler hostname is "" and the port doesn't reflect the Timescale UI information.
The UI for the pooler shows hostname similar to the non-pooler one (only with -pooler inside) and a port 5432 instead of the one returned from terraform

If you need any other info let me know

@Khyme
Copy link
Contributor

Khyme commented Jan 29, 2024

Thank you for your feedback, looking into it!

@shababq
Copy link

shababq commented Feb 5, 2024

facing this same issue i have added more details in this link
#142 (comment)

@luqasn
Copy link

luqasn commented Jun 7, 2024

I am also facing this problem, is there a solution yet?

@gabrifilaWiseair
Copy link

Hello
We noticed that the pooler url follows a certain structure when the DB is in a VPC. For now we use this workaround (could break any time if Timescale changes it)

output "DB_HOSTNAME" {
  value       = strcontains(timescale_service.main.hostname, "forge") ? replace(timescale_service.main.hostname, "/([a-zA-Z\\d]+)(\\.)(.+)/", "$1-pooler$2$3") : timescale_service.main.hostname 
  description = "Probable hostname of the pooler of the DB"
}

output "DB_PORT" {
  value       = strcontains(timescale_service.main.hostname, "forge") ? 5432 : timescale_service.main.port 
  description = "Probable port of the connection pooler of the DB"
}

Let me know if you see any errors

@dan-island
Copy link

any update on this? this is a pain point for our IaC

@aranchelk
Copy link

Any update on this? I'm going to resort to string manipulation to hack this, but I'm sure that'll break at the worst possible time. Please fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants