Skip to content

Commit d48ebd4

Browse files
committed
fix: Correct privilege validation for db_users
1 parent 1c57a6c commit d48ebd4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ database(s). The user will be assigned a randomly generated password, and their
250250
credentials will be stored in AWS Secrets Manager. The ARN of the secret for
251251
each user is available in the `db_user_secret_arns` output.
252252

253-
| Name | Description | Type | Default | Required |
254-
| ---------- | ------------------------------------------------------------------------------------------------------------- | -------------- | ------------ | -------- |
255-
| databases | List of databases to grant the user access to. If left empty, the user will not have access to any databases. | `list(string)` | `[]` | no |
256-
| privileges | Privileges to grant on the databases for the user. The only valid value is `"readonly"`. | `string` | `"readonly"` | no |
253+
| Name | Description | Type | Default | Required |
254+
| ---------- | ---------------------------------------------------------------------------------------- | -------------- | ------------ | -------- |
255+
| databases | List of databases to grant the user access to. | `list(string)` | n/a | yes |
256+
| privileges | Privileges to grant on the databases for the user. The only valid value is `"readonly"`. | `string` | `"readonly"` | no |
257257

258258
### iam_db_users
259259

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ variable "db_users" {
144144
validation {
145145
condition = alltrue([
146146
for _, user in var.db_users :
147-
contains(["all", "readonly"], user.privileges)
147+
user.privileges == "readonly"
148148
])
149-
error_message = "Database user privileges must be \"all\" or \"readonly\"."
149+
error_message = "Database user privileges must be \"readonly\"; only read-only access is supported for db_users."
150150
}
151151
}
152152

0 commit comments

Comments
 (0)