terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

Feature request - allow provider variable assignment from postgres:// url (automatic parse)

Open sgoley opened this issue 4 years ago • 1 comments

This is mostly a feature request but is there any reason that the postgres provider does not already allow the usage of a URI / URL instead of forcing the explicit assignment of these variables?

typical postgres uri: postgresql://[user[:password]@][netloc][:port][,...][/dbname]

Terraform Version

Terraform v0.12.25

Affected Resource(s)

NA

Terraform Configuration Files

provider "postgresql" {
  host            = "postgres_server_ip"
  port            = 5432
  database        = "postgres"
  username        = "postgres_user"
  password        = "postgres_password"
  sslmode         = "require"
  connect_timeout = 15
}

Expected Behavior

provider "postgresql" {
  url = "postgres://username:password@host:port/database"
  sslmode = "require"
  connect_timeout = 15
}

Actual Behavior

N/A

Steps to Reproduce

  1. Use Postgres Provider in tf config file.

sgoley avatar May 30 '20 01:05 sgoley

Hi @sgoley ,

Thanks for opening this feature request.

is there any reason that the postgres provider does not already allow the usage of a URI / URL instead of forcing the explicit assignment of these variables?

No reason I think, just nobody asked for it until now :)

I note this request and will let you know here when we can work on it.

cyrilgdn avatar May 31 '20 13:05 cyrilgdn