Skip to content

feat: Add role parameter to configure password length #38

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ locals {
resource "random_password" "default" {
for_each = local.roles_set

length = 16
length = each.value.password_length
special = false
}

Expand Down
9 changes: 6 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ variable "databases" {
template:
The name of the template database from which to create the database. For `non-RDS` should be `template0`.
encoding:
Character set encoding to use in the database.
Character set encoding to use in the database.
lc_collate:
Collation order to use in the database.
lc_ctype:
Character classification to use in the database.
Character classification to use in the database.
DOC
}

Expand Down Expand Up @@ -70,6 +70,7 @@ variable "roles" {
sequence_privileges = optional(list(string))
revoke_public = optional(bool, true)
ignore_changes_privileges = optional(list(string), [])
password_length = optional(number, 16)
}
)
)
Expand Down Expand Up @@ -110,7 +111,7 @@ variable "roles" {
bypass_row_level_security:
Defines whether a role bypasses every row-level security (RLS) policy.
connection_limit:
How many concurrent connections the role can establish.
How many concurrent connections the role can establish.
encrypted_password:
Defines whether the password is stored encrypted in the system catalogs.
roles:
Expand All @@ -131,5 +132,7 @@ variable "roles" {
Whether to revoke non-granted privileges form the role.
ignore_changes_privileges:
List of objects for which privilege changes should be ignored.
password_length:
The length of the password to generate.
DOC
}