cyrilgdn / terraform-provider-postgresql

Terraform PostgreSQL provider
https://www.terraform.io/docs/providers/postgresql/
Mozilla Public License 2.0
356 stars 182 forks source link

Cannot create replication users AWS rds admin #299

Open SeleniumK opened 1 year ago

SeleniumK commented 1 year ago

Hi there,

Thank you for opening an issue. Please provide the following information:

Terraform Version

Terraform 1.3 cyrilgdn/postgresql 1.19.0

Affected Resource(s)

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

provider "postgresql" {
  alias           = "nursery_0_app_database"
  host            = local.nursery_0_host
  port            = 5432
  database        = postgresql_database.graduation_test_db.name
  username        = "postgres"
  password        = <>
  sslmode         = "require"
  connect_timeout = 15
  superuser       = false
}

# user is rds admin user

resource "postgresql_role" "cdc_role" {
  name        = "cdc_role"
  replication = true
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

What should have happened? The cdc_role should have included replication permissions

Actual Behavior

What actually happened?

Error: error creating role cdc_role: pq: must be superuser to create replication users

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs? n/a

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? Seems similar to the issue below https://github.com/hashicorp/terraform-provider-postgresql/issues/157