-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
44 lines (33 loc) · 1.91 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
# Copyright (c) 2022 Oracle Corporation and/or affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
output "drg_id" {
description = "id of drg if it is created"
value = join(",", length(data.oci_core_drgs.drg_data.drgs) == 0 ? oci_core_drg.drg[*].id : data.oci_core_drgs.drg_data.drgs[*].id)
}
output "drg_display_name" {
description = "display name of drg if it is created"
value = join(",", length(data.oci_core_drgs.drg_data.drgs) == 0 ? oci_core_drg.drg[*].display_name : data.oci_core_drgs.drg_data.drgs[*].display_name)
}
# Complete outputs for each resources with provider parity. Auto-updating.
# Useful for module composition.
output "drg_all_attributes" {
description = "all attributes of created drg"
value = { for k, v in(length(data.oci_core_drgs.drg_data.drgs) == 0 ? (length(oci_core_drg.drg) > 0 ? oci_core_drg.drg[0] : {}) : data.oci_core_drgs.drg_data.drgs[0]) : k => v }
}
output "drg_attachment_all_attributes" {
description = "all attributes related to drg attachment"
value = { for k, v in oci_core_drg_attachment.vcns : k => v }
}
output "drg_summary" {
description = "drg information summary"
value = length(data.oci_core_drgs.drg_data.drgs) > 0 ? { id : data.oci_core_drgs.drg_data.drgs[0].id, vcn_attachments = { for k, v in oci_core_drg_attachment.vcns : k => v.network_details[0].id }} : length(oci_core_drg.drg) > 0 ? { id : oci_core_drg.drg[0].id, vcn_attachments = { for k, v in oci_core_drg_attachment.vcns : k => v.network_details[0].id }} : null
}
# RPCS
output "rpc_ids" {
description = "IDs of created RPCs"
value = values(oci_core_remote_peering_connection.rpcs)[*].id
}
output "rpc_all_attributes" {
description = "all attributes of created RPCs"
value = { for k, v in oci_core_remote_peering_connection.rpcs : k => v }
}