-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathoutputs.tf
40 lines (37 loc) · 1.58 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
40
##############################################################################
# Outputs
##############################################################################
# expand buckets, pull all elements except bucket_resource_key
# iterate over list (...) and merge() back to map
output "buckets" {
description = "Map of buckets created in the Cloud Object Storage Instance"
value = merge([for name, bucket in module.buckets : { (name) = {
"resource_group_id" = bucket.resource_group_id
"s3_endpoint_private" = bucket.s3_endpoint_private
"s3_endpoint_public" = bucket.s3_endpoint_public
"s3_endpoint_direct" = bucket.s3_endpoint_direct
"bucket_id" = bucket.bucket_id
"bucket_crn" = bucket.bucket_crn
"bucket_name" = bucket.bucket_name
"bucket_storage_class" = bucket.bucket_storage_class
"kms_key_crn" = bucket.kms_key_crn
"cos_instance_id" = bucket.cos_instance_id
"cos_instance_guid" = bucket.cos_instance_guid
"bucket_cbr_rules" = bucket.bucket_cbr_rules
"instance_cbr_rules" = bucket.instance_cbr_rules
"cbr_rule_ids" = bucket.cbr_rule_ids
# skip resource_keys because it is sensitive
} }]...)
}
output "bucket_configs" {
description = "List of bucket config definitions"
value = var.bucket_configs
}
output "cbr_rules" {
description = "List of COS bucket CBR rules"
value = flatten([for _, bucket in module.buckets : bucket.bucket_cbr_rules])
}
output "cbr_rule_ids" {
description = "List of bucket CBR rule ids"
value = local.bucket_rule_ids
}