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

postgresql_grant resource should allow empty list of privileges #197

@kamil-rogon-dragon

Description

@kamil-rogon-dragon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions