Skip to content

Commit

Permalink
feat: add outputs for cluster endpoint urls (#862)<br> - added new ou…
Browse files Browse the repository at this point in the history
…tputs for cluster endpoints: public and private service endpoints, ingress subdomain, and web console

* feat: added public service endpint url for the cluster

* feat: added public service endpint url for the cluster

* feat: added public service endpint url for the cluster

* feat: added networking urls for the clsuter

* feat: added networking urls for the clsuter

* feat: added networking urls for the clsuter

---------

Co-authored-by: Rajat Agrawal <[email protected]>
Co-authored-by: Conall Ó Cofaigh <[email protected]>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent 9fe2a93 commit 6f65f1b
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 6 deletions.
16 changes: 10 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,16 @@ output "cluster_data" {
value = {
for cluster in ibm_container_vpc_cluster.cluster :
cluster.name => {
crn = cluster.crn
id = cluster.id
resource_group_name = cluster.resource_group_name
resource_group_id = cluster.resource_group_id
vpc_id = cluster.vpc_id
region = var.region
crn = cluster.crn
id = cluster.id
resource_group_name = cluster.resource_group_name
resource_group_id = cluster.resource_group_id
vpc_id = cluster.vpc_id
region = var.region
private_service_endpoint_url = cluster.private_service_endpoint_url
public_service_endpoint_url = (cluster.public_service_endpoint_url != "" && cluster.public_service_endpoint_url != null) ? cluster.public_service_endpoint_url : null
ingress_hostname = cluster.ingress_hostname
cluster_console_url = (cluster.public_service_endpoint_url != "" && cluster.public_service_endpoint_url != null) ? "https://console-openshift-console.${cluster.ingress_hostname}" : null
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions patterns/roks-quickstart/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,46 @@ output "management_cluster_id" {
value = module.landing_zone.management_cluster_id
}

output "workload_cluster_ingress_hostname" {
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
value = module.landing_zone.workload_cluster_ingress_hostname
}

output "management_cluster_ingress_hostname" {
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
value = module.landing_zone.management_cluster_ingress_hostname
}

output "workload_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Workload cluster, if not then null."
value = module.landing_zone.workload_cluster_private_service_endpoint_url
}

output "management_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Management cluster, if not then null."
value = module.landing_zone.management_cluster_private_service_endpoint_url
}

output "workload_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Workload cluster, if not then null."
value = module.landing_zone.workload_cluster_public_service_endpoint_url
}

output "management_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Management cluster, if not then null."
value = module.landing_zone.management_cluster_public_service_endpoint_url
}

output "workload_cluster_console_url" {
description = "Workload cluster console URL, if not then null."
value = module.landing_zone.workload_cluster_console_url
}

output "management_cluster_console_url" {
description = "Management cluster console URL, if not then null."
value = module.landing_zone.management_cluster_console_url
}

output "key_management_name" {
description = "Name of key management service"
value = module.landing_zone.key_management_name
Expand Down
88 changes: 88 additions & 0 deletions patterns/roks/module/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,94 @@ output "management_cluster_id" {
value = module.landing_zone.management_cluster_id
}

output "workload_cluster_ingress_hostname" {
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.ingress_hostname
if can(regex("workload", name))
])
)
}

output "management_cluster_ingress_hostname" {
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.ingress_hostname
if can(regex("management", name))
])
)
}

output "workload_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Workload cluster, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.private_service_endpoint_url
if can(regex("workload", name))
])
)
}

output "management_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Management cluster, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.private_service_endpoint_url
if can(regex("management", name))
])
)
}

output "workload_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Workload cluster, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.public_service_endpoint_url
if can(regex("workload", name))
])
)
}

output "management_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Management cluster, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.public_service_endpoint_url
if can(regex("management", name))
])
)
}

output "workload_cluster_console_url" {
description = "Workload cluster console URL, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.cluster_console_url
if can(regex("workload", name))
])
)
}

output "management_cluster_console_url" {
description = "Management cluster console URL, if not then null."
value = one(
flatten([
for name, cluster in module.landing_zone.cluster_data :
cluster.cluster_console_url
if can(regex("management", name))
])
)
}

output "key_management_name" {
description = "Name of key management service"
value = module.landing_zone.key_management_name
Expand Down
40 changes: 40 additions & 0 deletions patterns/roks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,46 @@ output "management_cluster_id" {
value = module.roks_landing_zone.management_cluster_id
}

output "workload_cluster_ingress_hostname" {
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
value = module.roks_landing_zone.workload_cluster_ingress_hostname
}

output "management_cluster_ingress_hostname" {
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
value = module.roks_landing_zone.management_cluster_ingress_hostname
}

output "workload_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Workload cluster, if not then null."
value = module.roks_landing_zone.workload_cluster_private_service_endpoint_url
}

output "management_cluster_private_service_endpoint_url" {
description = "The private service endpoint URL of the Management cluster, if not then null."
value = module.roks_landing_zone.management_cluster_private_service_endpoint_url
}

output "workload_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Workload cluster, if not then null."
value = module.roks_landing_zone.workload_cluster_public_service_endpoint_url
}

output "management_cluster_public_service_endpoint_url" {
description = "The public service endpoint URL of the Management cluster, if not then null."
value = module.roks_landing_zone.management_cluster_public_service_endpoint_url
}

output "workload_cluster_console_url" {
description = "Workload cluster console URL, if not then null."
value = module.roks_landing_zone.workload_cluster_console_url
}

output "management_cluster_console_url" {
description = "Management cluster console URL, if not then null."
value = module.roks_landing_zone.management_cluster_console_url
}

output "key_management_name" {
description = "Name of key management service"
value = module.roks_landing_zone.key_management_name
Expand Down

0 comments on commit 6f65f1b

Please sign in to comment.