Skip to content

Commit 6f65f1b

Browse files
rajatagarwal-ibmRajat Agrawalocofaigh
authored
feat: add outputs for cluster endpoint urls (#862)<br> - added new outputs 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 <rajat.agrawal@ibm.com> Co-authored-by: Conall Ó Cofaigh <ocofaigh@ie.ibm.com>
1 parent 9fe2a93 commit 6f65f1b

File tree

4 files changed

+178
-6
lines changed

4 files changed

+178
-6
lines changed

outputs.tf

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,16 @@ output "cluster_data" {
8989
value = {
9090
for cluster in ibm_container_vpc_cluster.cluster :
9191
cluster.name => {
92-
crn = cluster.crn
93-
id = cluster.id
94-
resource_group_name = cluster.resource_group_name
95-
resource_group_id = cluster.resource_group_id
96-
vpc_id = cluster.vpc_id
97-
region = var.region
92+
crn = cluster.crn
93+
id = cluster.id
94+
resource_group_name = cluster.resource_group_name
95+
resource_group_id = cluster.resource_group_id
96+
vpc_id = cluster.vpc_id
97+
region = var.region
98+
private_service_endpoint_url = cluster.private_service_endpoint_url
99+
public_service_endpoint_url = (cluster.public_service_endpoint_url != "" && cluster.public_service_endpoint_url != null) ? cluster.public_service_endpoint_url : null
100+
ingress_hostname = cluster.ingress_hostname
101+
cluster_console_url = (cluster.public_service_endpoint_url != "" && cluster.public_service_endpoint_url != null) ? "https://console-openshift-console.${cluster.ingress_hostname}" : null
98102
}
99103
}
100104
}

patterns/roks-quickstart/outputs.tf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,46 @@ output "management_cluster_id" {
6767
value = module.landing_zone.management_cluster_id
6868
}
6969

70+
output "workload_cluster_ingress_hostname" {
71+
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
72+
value = module.landing_zone.workload_cluster_ingress_hostname
73+
}
74+
75+
output "management_cluster_ingress_hostname" {
76+
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
77+
value = module.landing_zone.management_cluster_ingress_hostname
78+
}
79+
80+
output "workload_cluster_private_service_endpoint_url" {
81+
description = "The private service endpoint URL of the Workload cluster, if not then null."
82+
value = module.landing_zone.workload_cluster_private_service_endpoint_url
83+
}
84+
85+
output "management_cluster_private_service_endpoint_url" {
86+
description = "The private service endpoint URL of the Management cluster, if not then null."
87+
value = module.landing_zone.management_cluster_private_service_endpoint_url
88+
}
89+
90+
output "workload_cluster_public_service_endpoint_url" {
91+
description = "The public service endpoint URL of the Workload cluster, if not then null."
92+
value = module.landing_zone.workload_cluster_public_service_endpoint_url
93+
}
94+
95+
output "management_cluster_public_service_endpoint_url" {
96+
description = "The public service endpoint URL of the Management cluster, if not then null."
97+
value = module.landing_zone.management_cluster_public_service_endpoint_url
98+
}
99+
100+
output "workload_cluster_console_url" {
101+
description = "Workload cluster console URL, if not then null."
102+
value = module.landing_zone.workload_cluster_console_url
103+
}
104+
105+
output "management_cluster_console_url" {
106+
description = "Management cluster console URL, if not then null."
107+
value = module.landing_zone.management_cluster_console_url
108+
}
109+
70110
output "key_management_name" {
71111
description = "Name of key management service"
72112
value = module.landing_zone.key_management_name

patterns/roks/module/outputs.tf

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,94 @@ output "management_cluster_id" {
9292
value = module.landing_zone.management_cluster_id
9393
}
9494

95+
output "workload_cluster_ingress_hostname" {
96+
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
97+
value = one(
98+
flatten([
99+
for name, cluster in module.landing_zone.cluster_data :
100+
cluster.ingress_hostname
101+
if can(regex("workload", name))
102+
])
103+
)
104+
}
105+
106+
output "management_cluster_ingress_hostname" {
107+
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
108+
value = one(
109+
flatten([
110+
for name, cluster in module.landing_zone.cluster_data :
111+
cluster.ingress_hostname
112+
if can(regex("management", name))
113+
])
114+
)
115+
}
116+
117+
output "workload_cluster_private_service_endpoint_url" {
118+
description = "The private service endpoint URL of the Workload cluster, if not then null."
119+
value = one(
120+
flatten([
121+
for name, cluster in module.landing_zone.cluster_data :
122+
cluster.private_service_endpoint_url
123+
if can(regex("workload", name))
124+
])
125+
)
126+
}
127+
128+
output "management_cluster_private_service_endpoint_url" {
129+
description = "The private service endpoint URL of the Management cluster, if not then null."
130+
value = one(
131+
flatten([
132+
for name, cluster in module.landing_zone.cluster_data :
133+
cluster.private_service_endpoint_url
134+
if can(regex("management", name))
135+
])
136+
)
137+
}
138+
139+
output "workload_cluster_public_service_endpoint_url" {
140+
description = "The public service endpoint URL of the Workload cluster, if not then null."
141+
value = one(
142+
flatten([
143+
for name, cluster in module.landing_zone.cluster_data :
144+
cluster.public_service_endpoint_url
145+
if can(regex("workload", name))
146+
])
147+
)
148+
}
149+
150+
output "management_cluster_public_service_endpoint_url" {
151+
description = "The public service endpoint URL of the Management cluster, if not then null."
152+
value = one(
153+
flatten([
154+
for name, cluster in module.landing_zone.cluster_data :
155+
cluster.public_service_endpoint_url
156+
if can(regex("management", name))
157+
])
158+
)
159+
}
160+
161+
output "workload_cluster_console_url" {
162+
description = "Workload cluster console URL, if not then null."
163+
value = one(
164+
flatten([
165+
for name, cluster in module.landing_zone.cluster_data :
166+
cluster.cluster_console_url
167+
if can(regex("workload", name))
168+
])
169+
)
170+
}
171+
172+
output "management_cluster_console_url" {
173+
description = "Management cluster console URL, if not then null."
174+
value = one(
175+
flatten([
176+
for name, cluster in module.landing_zone.cluster_data :
177+
cluster.cluster_console_url
178+
if can(regex("management", name))
179+
])
180+
)
181+
}
182+
95183
output "key_management_name" {
96184
description = "Name of key management service"
97185
value = module.landing_zone.key_management_name

patterns/roks/outputs.tf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,46 @@ output "management_cluster_id" {
9292
value = module.roks_landing_zone.management_cluster_id
9393
}
9494

95+
output "workload_cluster_ingress_hostname" {
96+
description = "The hostname assigned for the Workload cluster ingress subdomain, if not then null."
97+
value = module.roks_landing_zone.workload_cluster_ingress_hostname
98+
}
99+
100+
output "management_cluster_ingress_hostname" {
101+
description = "The hostname assigned for the Management cluster ingress subdomain, if not then null."
102+
value = module.roks_landing_zone.management_cluster_ingress_hostname
103+
}
104+
105+
output "workload_cluster_private_service_endpoint_url" {
106+
description = "The private service endpoint URL of the Workload cluster, if not then null."
107+
value = module.roks_landing_zone.workload_cluster_private_service_endpoint_url
108+
}
109+
110+
output "management_cluster_private_service_endpoint_url" {
111+
description = "The private service endpoint URL of the Management cluster, if not then null."
112+
value = module.roks_landing_zone.management_cluster_private_service_endpoint_url
113+
}
114+
115+
output "workload_cluster_public_service_endpoint_url" {
116+
description = "The public service endpoint URL of the Workload cluster, if not then null."
117+
value = module.roks_landing_zone.workload_cluster_public_service_endpoint_url
118+
}
119+
120+
output "management_cluster_public_service_endpoint_url" {
121+
description = "The public service endpoint URL of the Management cluster, if not then null."
122+
value = module.roks_landing_zone.management_cluster_public_service_endpoint_url
123+
}
124+
125+
output "workload_cluster_console_url" {
126+
description = "Workload cluster console URL, if not then null."
127+
value = module.roks_landing_zone.workload_cluster_console_url
128+
}
129+
130+
output "management_cluster_console_url" {
131+
description = "Management cluster console URL, if not then null."
132+
value = module.roks_landing_zone.management_cluster_console_url
133+
}
134+
95135
output "key_management_name" {
96136
description = "Name of key management service"
97137
value = module.roks_landing_zone.key_management_name

0 commit comments

Comments
 (0)