-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoutputs.tf
39 lines (37 loc) · 1.32 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
output "this" {
value = {
for name in keys(var.databases) : name => {
"instance" = scaleway_rdb_instance.this[name],
"acls" = lookup(scaleway_rdb_acl.this, name, []),
"users" = [
for identifier, config in local.user_by_database : {
"username" : config.user.username,
"is_admin" : config.user.is_admin,
"password" : random_password.this[identifier].result,
"identifier" : identifier
} if config.database == name
],
"dbs" = [
for identifier, config in local.dbs_by_database :
scaleway_rdb_database.this[identifier]
if config.database == name
]
}
}
description = "A map of the scaleway_rdb_database (including their users) and scaleway_rdb_instance resources grouped by databases definitions"
sensitive = true
}
output "instances" {
sensitive = true
value = {
for name in keys(var.databases) : name => scaleway_rdb_instance.this[name]
}
description = "A map of each created scaleway_rdb_instance with each `var.databases` definition as key"
}
output "databases" {
value = {
for identifier, config in local.dbs_by_database :
config.database => scaleway_rdb_database.this[identifier]...
}
description = "A map of each created scaleway_rdb_instance with each `var.databases` definition as key"
}