diff --git a/README.md b/README.md index 9a25f871d..d70580d80 100644 --- a/README.md +++ b/README.md @@ -957,6 +957,7 @@ module "cluster_pattern" { | [key\_management\_name](#output\_key\_management\_name) | Name of key management service | | [key\_map](#output\_key\_map) | Map of ids and keys for keys created | | [key\_rings](#output\_key\_rings) | Key rings created by module | +| [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. | | [placement\_groups](#output\_placement\_groups) | List of placement groups. | | [resource\_group\_data](#output\_resource\_group\_data) | List of resource groups data used within landing zone. | | [resource\_group\_names](#output\_resource\_group\_names) | List of resource groups names used within landing zone. | @@ -979,6 +980,7 @@ module "cluster_pattern" { | [vpn\_names](#output\_vpn\_names) | List of VPN names | | [vsi\_data](#output\_vsi\_data) | A list of VSI with name, id, zone, and primary ipv4 address, VPC Name, and floating IP. | | [vsi\_names](#output\_vsi\_names) | List of VSI names | +| [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. | diff --git a/outputs.tf b/outputs.tf index 2e695890f..576c7aeb5 100644 --- a/outputs.tf +++ b/outputs.tf @@ -74,6 +74,16 @@ output "cluster_names" { ] } +output "workload_cluster_id" { + description = "The id of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null." + value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-workload-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-workload-cluster"].id : null +} + +output "management_cluster_id" { + description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null." + value = lookup(ibm_container_vpc_cluster.cluster, "${var.prefix}-management-cluster", null) != null ? ibm_container_vpc_cluster.cluster["${var.prefix}-management-cluster"].id : null +} + output "cluster_data" { description = "List of cluster data" value = { diff --git a/patterns/roks/module/outputs.tf b/patterns/roks/module/outputs.tf index ec28973f8..2d341ee4f 100644 --- a/patterns/roks/module/outputs.tf +++ b/patterns/roks/module/outputs.tf @@ -82,6 +82,16 @@ output "cluster_data" { value = module.landing_zone.cluster_data } +output "workload_cluster_id" { + description = "The id of the worload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null." + value = module.landing_zone.workload_cluster_id +} + +output "management_cluster_id" { + description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null." + value = module.landing_zone.management_cluster_id +} + output "key_management_name" { description = "Name of key management service" value = module.landing_zone.key_management_name diff --git a/patterns/roks/outputs.tf b/patterns/roks/outputs.tf index ae0392703..0dcb8425e 100644 --- a/patterns/roks/outputs.tf +++ b/patterns/roks/outputs.tf @@ -82,6 +82,16 @@ output "cluster_data" { value = module.roks_landing_zone.cluster_data } +output "workload_cluster_id" { + description = "The id of the workload cluster. If the cluster name does not exactly match the prefix-workload-cluster pattern it will be null." + value = module.roks_landing_zone.workload_cluster_id +} + +output "management_cluster_id" { + description = "The id of the management cluster. If the cluster name does not exactly match the prefix-management-cluster pattern it will be null." + value = module.roks_landing_zone.management_cluster_id +} + output "key_management_name" { description = "Name of key management service" value = module.roks_landing_zone.key_management_name