-
Notifications
You must be signed in to change notification settings - Fork 127
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
rdb: allow to set permission on a database for a user #847
Comments
In the meantime: resource "null_resource" "pgsql_user_access_db" {
provisioner "local-exec" {
command = "scw rdb privilege set instance-id=${split("/", scaleway_rdb_instance.postgresql_instance[0].id)[1]} database-name=${scaleway_rdb_database.postgresql_auth_db[0].name} user-name=${scaleway_rdb_user.postgresql_user[0].name} permission=all region=${var.scw_region}"
environment = {
SCW_ACCESS_KEY = var.scw_access_key
SCW_SECRET_KEY = var.scw_secret_key
SCW_DEFAULT_ORGANIZATION_ID = var.scw_organisation_id
SCW_DEFAULT_PROJECT_ID = var.scw_project_id
SCW_DEFAULT_REGION = var.scw_region
SCW_DEFAULT_ZONE = var.scw_zone
}
}
provisioner "local-exec" {
when = destroy
command = "true"
}
} |
Thanks @nsteinmetz for the workaround! I see the RDB API uses resource "scaleway_rdb_privilege" "database_user_privilage" {
user_id = scaleway_rdb_user.database_user.id
database_id = scaleway_rdb_database.database_database.id
privilege = "readwrite" # defaults to readonly like the API?
} EDIT: I just re-read the API and in fact we need |
I just saw #844 seems to address this issue. |
Indeed, I missed it - closing here and I'll follow the PR. |
Community Note
Description
Created user via scaleway_rdb_user has no access to any db by default. There is no terraform way to grant access to a db to a user.
I would like that my next action is something like
New or Affected Resource(s)
Potential Terraform Configuration
With policy being:
Read
ReadWrite
All
None
Custom
?References
N/A
The text was updated successfully, but these errors were encountered: