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

postgresql_grant resource should allow empty list of privileges #197

Open
kamil-rogon-dragon opened this issue Oct 28, 2020 · 1 comment

Comments

@kamil-rogon-dragon
Copy link

kamil-rogon-dragon commented Oct 28, 2020

Hi there,
This is probably a feature request.

Terraform Version

Terraform v0.12.29
+ provider.postgresql v1.7.1

Affected Resource(s)

Please list the resources as a list, for example:

  • postgresql_grant

Terraform Configuration Files

resource "postgresql_database" "this" {
  name  = var.name
  owner = var.main_username
}

resource "postgresql_grant" "database_to_public" {
  object_type = "database"
  database    = postgresql_database.this.name
  role        = "public"
  privileges  = []
}

Expected Behavior

It should be possible to have empty list of privileges, that is equivalent of "REVOKE ALL". This would allow to delete some default permission that postgresql creates (ex. for public schema).

Actual Behavior

TF validation for privilege parameter is set to MinItems=1 and returns an error.

Steps to Reproduce

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

  1. terraform plan
@david-ecc
Copy link

Same problem here, i need to remove access to databases for all users ('REVOKE ALL ON DATABASE XXX FROM PUBLIC').

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

2 participants