Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-1484 Add New Resource For Alter Role #1

Merged
merged 2 commits into from
May 18, 2022

Conversation

bmedlock-depop
Copy link

@bmedlock-depop bmedlock-depop commented May 12, 2022

This change will add in a new resource to the provider, ALTER_ROLE.

The resource is designed to be used where you need to alter certain attributes on a role globally and not just on a specific database.

Also included are tests for the resource and updating of the docs for the provider.

There are no outputs associated with this resource, but it can certainly be tied into the create role resource that exists already within the provider. postgresql_role TF Doc

Upstream PR: cyrilgdn#211

Example SQL Commands

Here we have examples of the kind of 'ALTER ROLE' commands that it is running in the background. Showing the type of commands that you would use this resource to automate.

YES 👍

ALTER ROLE test_role SET pgaudit.log TO 'ALL';

NO 👎

ALTER ROLE test_role IN DATABASE test SET pgaudit.log TO 'ALL';

ALTER ROLE test_role WITH PASSWORD NULL;

Example syntax

General Syntax

resource "postgresql_alter_role" "set_pgaudit_logging" {
  role            = "test_role"
  parameter_key   = "pgaudit.log"
  parameter_value = "ALL"
}

General syntax with role creation referenced

resource "postgresql_role" "pgaudit_role" {
  name = "test_pgaudit_role"
}

resource "postgresql_alter_role" "set_pgaudit_logging" {
  role                      = postgresql_role.pgaudit_role.name
  parameter_key    = "pgaudit.log"
  parameter_value = "ALL"
}

@bmedlock-depop bmedlock-depop changed the title Plat 1484 add alter role resource PLAT-1484 Add New Resource For Alter Role May 17, 2022
@bmedlock-depop bmedlock-depop requested a review from a team May 17, 2022 13:33
@bmedlock-depop bmedlock-depop marked this pull request as ready for review May 17, 2022 13:33
@bmedlock-depop bmedlock-depop force-pushed the PLAT-1484-add-alter-role-resource branch 3 times, most recently from 806b1cc to a0ba6ed Compare May 17, 2022 13:49
@bmedlock-depop bmedlock-depop force-pushed the PLAT-1484-add-alter-role-resource branch from 6ff2d92 to 065e9e9 Compare May 17, 2022 13:57
@bmedlock-depop bmedlock-depop requested a review from rymir May 17, 2022 16:09
@bmedlock-depop bmedlock-depop requested a review from rymir May 18, 2022 11:08
@bmedlock-depop bmedlock-depop merged commit 9b69310 into master May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants