Skip to content

Commit d97823d

Browse files
authored
Merge pull request #6 from particuleio/fix/make-acls-optional
fix: Add a default value for ACL configuration
2 parents ab1de2f + 7301a34 commit d97823d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

acls.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "scaleway_rdb_acl" "this" {
2-
for_each = local.databases
2+
for_each = { for database, config in local.databases : database => config if length(config.acls) > 0 }
33

44
instance_id = scaleway_rdb_instance.this[each.key].id
55

locals.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ locals {
2828
node_type = "DB-DEV-S"
2929
users = []
3030
settings = {}
31+
acls = []
3132
}
3233
databases = {
3334
for database_name, config in var.databases :

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "this" {
33
for name in keys(var.databases) : name => {
44
"instance" = scaleway_rdb_instance.this[name],
55
"database" = scaleway_rdb_database.this[name],
6-
"acls" = scaleway_rdb_acl.this[name],
6+
"acls" = lookup(scaleway_rdb_acl.this, name, []),
77
"users" = [
88
for identifier, config in local.user_by_database : {
99
"username" : config.user.username,

0 commit comments

Comments
 (0)