-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoutputs.tf
53 lines (48 loc) · 2.3 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
41
42
43
44
45
46
47
48
49
50
51
52
53
##############################################################################
# Outputs
##############################################################################
output "cos_suffix" {
description = "Random suffix appended to the end of COS resources"
value = local.suffix
}
output "cos_instances" {
description = "List of COS resource instances with shortname, name, id, and crn."
value = [
for instance in var.cos :
{
shortname = instance.name
name = instance.use_data == true ? data.ibm_resource_instance.cos[instance.name].name : ibm_resource_instance.cos[instance.name].name
id = instance.use_data == true ? data.ibm_resource_instance.cos[instance.name].id : ibm_resource_instance.cos[instance.name].id
crn = instance.use_data == true ? data.ibm_resource_instance.cos[instance.name].crn : ibm_resource_instance.cos[instance.name].crn
}
]
}
output "cos_buckets" {
description = "List of COS bucket instances with shortname, instance_shortname, name, id, crn, and instance id."
value = [
for bucket in module.cos_bucket_map.value :
{
instance_shortname = bucket.instance
instance_id = bucket.use_data == true ? data.ibm_resource_instance.cos[bucket.instance].id : ibm_resource_instance.cos[bucket.instance].id
shortname = bucket.name
id = ibm_cos_bucket.bucket[bucket.name].id
name = ibm_cos_bucket.bucket[bucket.name].bucket_name
crn = ibm_cos_bucket.bucket[bucket.name].crn
}
]
}
output "cos_keys" {
description = "List of COS bucket instances with shortname, instance_shortname, name, id, crn, and instance id."
value = [
for resource_key in module.cos_key_map.value :
{
instance_shortname = resource_key.instance
instance_id = resource_key.use_data == true ? data.ibm_resource_instance.cos[resource_key.instance].id : ibm_resource_instance.cos[resource_key.instance].id
shortname = resource_key.name
id = ibm_resource_key.key[resource_key.name].id
name = ibm_resource_key.key[resource_key.name].name
crn = ibm_resource_key.key[resource_key.name].crn
}
]
}
##############################################################################