-
-
Notifications
You must be signed in to change notification settings - Fork 2
Allow setting roles for users #46
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
base: main
Are you sure you want to change the base?
Allow setting roles for users #46
Conversation
WalkthroughAdds a new optional Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Terraform Root
participant Var as additional_users (var)
participant Mod as postgresql-user module
participant Res as postgresql_role resource
participant DB as PostgreSQL Server
Dev->>Var: Iterate users (db_user, db_password, grants, roles)
Dev->>Mod: Pass user inputs including roles
Mod->>Mod: local.db_roles = var.roles or null
Mod->>Res: Create role/user with roles = local.db_roles
Res->>DB: Apply role creation and grants
DB-->>Res: Result (success/error)
Res-->>Dev: Provision outcome
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (2)src/@(main|variables|outputs|providers|versions|context).tf📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.tf📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main.tf
(1 hunks)src/modules/postgresql-user/main.tf
(3 hunks)src/modules/postgresql-user/variables.tf
(1 hunks)src/variables.tf
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.tf
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.tf
: Use 2-space indentation in Terraform files
In Terraform, use lower_snake_case for variables and locals
Keep Terraform resource and data source names descriptive and aligned with Cloud Posse null-label patterns
Run terraform fmt (recursive) and do not commit formatting violations
Follow TFLint rules as configured in .tflint.hcl; do not commit lint violations
Files:
src/modules/postgresql-user/main.tf
src/main.tf
src/modules/postgresql-user/variables.tf
src/variables.tf
src/@(main|variables|outputs|providers|versions|context).tf
📄 CodeRabbit inference engine (AGENTS.md)
Keep all Terraform component code in src/ and structure it into main.tf, variables.tf, outputs.tf, providers.tf, versions.tf, and context.tf (src is the source of truth)
Files:
src/main.tf
src/variables.tf
a573336
to
c64a4eb
Compare
variable "roles" { | ||
type = list(string) | ||
description = "Roles that will be granted to the created user." | ||
default = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default = null | |
default = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is the list pls set defaults to empty list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jochem725 could you pls address the changes?
variable "roles" { | ||
type = list(string) | ||
description = "Roles that will be granted to the created user." | ||
default = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jochem725 could you pls address the changes?
what
why
rds_superuser
role to a newly created user to manage extensions.references
Summary by CodeRabbit