Skip to content

Commit

Permalink
Add documentation for the security label resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Piet Schrijver committed Apr 18, 2024
1 parent fbfd8b9 commit 27eb69d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions website/docs/r/postgresql_security_label.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: "postgresql"
page_title: "PostgreSQL: postgresql_grant"
sidebar_current: "docs-postgresql-resource-postgresql_grant"
description: |-
Creates and manages privileges given to a user for a database schema.
---

# postgresql\_security\_label

The ``postgresql_security_label`` resource creates and manages security labels.

See [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-security-label.html)

~> **Note:** This resource needs Postgresql version 11 or above.

## Usage

```hcl
resource "postgresql_role" "my_role" {
name = "my_role"
login = true
}
resource "postgresql_security_label" "workload" {
object_type = "role"
object_name = postgresql_role.my_role.name
label_provider = "pgaadauth"
label = "aadauth,oid=00000000-0000-0000-0000-000000000000,type=service"
}
```

## Argument Reference

* `object_type` - (Required) The PostgreSQL object type to apply this security label to.
* `object_name` - (Required) The name of the object to be labeled. Names of objects that reside in schemas (tables, functions, etc.) can be schema-qualified.
* `label_provider` - (Required) The name of the provider with which this label is to be associated.
* `label` - (Required) The value of the security label.
3 changes: 3 additions & 0 deletions website/postgresql.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<li<%= sidebar_current("docs-postgresql-resource-postgresql_user_mapping") %>>
<a href="/docs/providers/postgresql/r/postgresql_user_mapping.html">postgresql_user_mapping</a>
</li>
<li<%= sidebar_current("docs-postgresql-resource-postgresql_security_label") %>>
<a href="/docs/providers/postgresql/r/postgresql_security_label.html">postgresql_security_label</a>
</li>
</ul>
</li>

Expand Down

0 comments on commit 27eb69d

Please sign in to comment.