Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

terraform progresql create role #163

Open
ghost opened this issue Jul 27, 2020 · 1 comment
Open

terraform progresql create role #163

ghost opened this issue Jul 27, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 27, 2020

This issue was originally opened by @Mike-Hawkins as hashicorp/terraform#25683. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.12.28
+ provider.postgresql v1.7.0
+ provider.random v2.3.0

Terraform Configuration Files

default.tf

provider "postgresql" {
  alias = "pg"
  host            = "tester.amazonaws.com"
  database        = "postgres"
  username        = "master"
  password        = "password"
  expected_version = "12.3"
}

resource "random_id" "password" {
  byte_length = 16
}

resource "postgresql_role" "default" {
  provider = "postgresql.pg"
  name = "tester_user"
  login = true
  password = random_id.password.hex
  encrypted_password = false
  inherit = false
}

Debug Output

Crash Output

Crash.log

Expected Behavior

Terraform should have created the role within the database

Actual Behavior

Crashing on terraform apply but, not on terraform plan

Steps to Reproduce

terraform init
terraform apply

Additional Context

The user that is being used for the role creation does have proper permissions to log into the database and create users

References

@Mike-Hawkins
Copy link

For future Reference. If you have the PGSERVICEFILE variable set you will get this error. After unsetting the variable it works as expected

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

No branches or pull requests

1 participant