Terraform resource: postgresql grant

From wikieduonline
Jump to navigation Jump to search

Official examples[edit]

# Grant SELECT privileges on 2 tables
resource "postgresql_grant" "readonly_tables" {
 database    = "test_db"
 role        = "test_role"
 schema      = "public"
 object_type = "table"
 objects     = ["table1", "table2"]
 privileges  = ["SELECT"]
}
# Grant SELECT & INSERT privileges on 2 columns in 1 table
resource "postgresql_grant" "read_insert_column" {
 database    = "test_db"
 role        = "test_role"
 schema      = "public"
 object_type = "column"
 objects     = ["table1"]
 columns     = ["col1", "col2"]
 privileges  = ["UPDATE", "INSERT"]
}


See also[edit]

Advertising: