Skip to content

Commit cae6de7

Browse files
feat: added workload_cluster_id and management_cluster_id outputs (#713)
1 parent c7d443d commit cae6de7

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ module "cluster_pattern" {
957957
| <a name="output_key_management_name"></a> [key\_management\_name](#output\_key\_management\_name) | Name of key management service |
958958
| <a name="output_key_map"></a> [key\_map](#output\_key\_map) | Map of ids and keys for keys created |
959959
| <a name="output_key_rings"></a> [key\_rings](#output\_key\_rings) | Key rings created by module |
960+
| <a name="output_management_cluster_id"></a> [management\_cluster\_id](#output\_management\_cluster\_id) | The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null. |
960961
| <a name="output_placement_groups"></a> [placement\_groups](#output\_placement\_groups) | List of placement groups. |
961962
| <a name="output_resource_group_data"></a> [resource\_group\_data](#output\_resource\_group\_data) | List of resource groups data used within landing zone. |
962963
| <a name="output_resource_group_names"></a> [resource\_group\_names](#output\_resource\_group\_names) | List of resource groups names used within landing zone. |
@@ -979,6 +980,7 @@ module "cluster_pattern" {
979980
| <a name="output_vpn_names"></a> [vpn\_names](#output\_vpn\_names) | List of VPN names |
980981
| <a name="output_vsi_data"></a> [vsi\_data](#output\_vsi\_data) | A list of VSI with name, id, zone, and primary ipv4 address, VPC Name, and floating IP. |
981982
| <a name="output_vsi_names"></a> [vsi\_names](#output\_vsi\_names) | List of VSI names |
983+
| <a name="output_workload_cluster_id"></a> [workload\_cluster\_id](#output\_workload\_cluster\_id) | The id of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null. |
982984
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
983985

984986
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->

outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ output "cluster_names" {
7474
]
7575
}
7676

77+
output "workload_cluster_id" {
78+
description = "The id of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
79+
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-workload-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-workload-cluster"].id : null
80+
}
81+
82+
output "management_cluster_id" {
83+
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
84+
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-management-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-management-cluster"].id : null
85+
}
86+
7787
output "cluster_data" {
7888
description = "List of cluster data"
7989
value = {

patterns/roks/module/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ output "cluster_data" {
8282
value = module.landing_zone.cluster_data
8383
}
8484

85+
output "workload_cluster_id" {
86+
description = "The id of the worload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
87+
value = module.landing_zone.workload_cluster_id
88+
}
89+
90+
output "management_cluster_id" {
91+
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
92+
value = module.landing_zone.management_cluster_id
93+
}
94+
8595
output "key_management_name" {
8696
description = "Name of key management service"
8797
value = module.landing_zone.key_management_name

patterns/roks/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ output "cluster_data" {
8282
value = module.roks_landing_zone.cluster_data
8383
}
8484

85+
output "workload_cluster_id" {
86+
description = "The id of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
87+
value = module.roks_landing_zone.workload_cluster_id
88+
}
89+
90+
output "management_cluster_id" {
91+
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
92+
value = module.roks_landing_zone.management_cluster_id
93+
}
94+
8595
output "key_management_name" {
8696
description = "Name of key management service"
8797
value = module.roks_landing_zone.key_management_name

0 commit comments

Comments
 (0)