Skip to content

Commit a6b3f6e

Browse files
authored
fix: added outputs for workload/management cluster names (#875)
* fix: added outputs for cluster names
1 parent 1f305c1 commit a6b3f6e

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
@@ -962,6 +962,7 @@ module "cluster_pattern" {
962962
| <a name="output_key_map"></a> [key\_map](#output\_key\_map) | Map of ids and keys for keys created |
963963
| <a name="output_key_rings"></a> [key\_rings](#output\_key\_rings) | Key rings created by module |
964964
| <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. |
965+
| <a name="output_management_cluster_name"></a> [management\_cluster\_name](#output\_management\_cluster\_name) | The name of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null. |
965966
| <a name="output_placement_groups"></a> [placement\_groups](#output\_placement\_groups) | List of placement groups. |
966967
| <a name="output_resource_group_data"></a> [resource\_group\_data](#output\_resource\_group\_data) | List of resource groups data used within landing zone. |
967968
| <a name="output_resource_group_names"></a> [resource\_group\_names](#output\_resource\_group\_names) | List of resource groups names used within landing zone. |
@@ -986,6 +987,7 @@ module "cluster_pattern" {
986987
| <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. |
987988
| <a name="output_vsi_names"></a> [vsi\_names](#output\_vsi\_names) | List of VSI names |
988989
| <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. |
990+
| <a name="output_workload_cluster_name"></a> [workload\_cluster\_name](#output\_workload\_cluster\_name) | The name of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null. |
989991
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
990992

991993
<!-- 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
@@ -79,11 +79,21 @@ output "workload_cluster_id" {
7979
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-workload-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-workload-cluster"].id : null
8080
}
8181

82+
output "workload_cluster_name" {
83+
description = "The name of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
84+
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-workload-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-workload-cluster"].name : null
85+
}
86+
8287
output "management_cluster_id" {
8388
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
8489
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-management-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-management-cluster"].id : null
8590
}
8691

92+
output "management_cluster_name" {
93+
description = "The name of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
94+
value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-management-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-management-cluster"].name : null
95+
}
96+
8797
output "cluster_data" {
8898
description = "List of cluster data"
8999
value = {

patterns/roks/module/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,21 @@ output "workload_cluster_id" {
8787
value = module.landing_zone.workload_cluster_id
8888
}
8989

90+
output "workload_cluster_name" {
91+
description = "The name of the worload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
92+
value = module.landing_zone.workload_cluster_name
93+
}
94+
9095
output "management_cluster_id" {
9196
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
9297
value = module.landing_zone.management_cluster_id
9398
}
9499

100+
output "management_cluster_name" {
101+
description = "The name of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
102+
value = module.landing_zone.management_cluster_name
103+
}
104+
95105
output "workload_cluster_ingress_hostname" {
96106
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
97107
value = one(

patterns/roks/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,21 @@ output "workload_cluster_id" {
8787
value = module.roks_landing_zone.workload_cluster_id
8888
}
8989

90+
output "workload_cluster_name" {
91+
description = "The name of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null."
92+
value = module.roks_landing_zone.workload_cluster_name
93+
}
94+
9095
output "management_cluster_id" {
9196
description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
9297
value = module.roks_landing_zone.management_cluster_id
9398
}
9499

100+
output "management_cluster_name" {
101+
description = "The name of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null."
102+
value = module.roks_landing_zone.management_cluster_name
103+
}
104+
95105
output "workload_cluster_ingress_hostname" {
96106
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
97107
value = module.roks_landing_zone.workload_cluster_ingress_hostname

0 commit comments

Comments
 (0)