Skip to content

Commit dd793aa

Browse files
authored
fix: add endpoint outputs to DA when passing existing EN instance (#583)
1 parent c98a91f commit dd793aa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

solutions/fully-configurable/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ data "ibm_resource_instance" "existing_en_instance" {
269269
identifier = local.existing_en_instance_guid
270270
}
271271

272+
locals {
273+
existing_en_endpoints = local.use_existing_en_instance ? { for key, value in data.ibm_resource_instance.existing_en_instance[0].extensions : key => value } : {}
274+
}
275+
272276
module "event_notifications" {
273277
count = local.use_existing_en_instance ? 0 : 1
274278
source = "../.."

solutions/fully-configurable/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ output "service_credential_secret_groups" {
4747

4848
output "event_notifications_private_endpoint" {
4949
description = "Event Notifications instance private endpoint URL"
50-
value = local.use_existing_en_instance ? null : module.event_notifications[0].event_notifications_private_endpoint
50+
value = local.use_existing_en_instance ? local.existing_en_endpoints["endpoints.private"] : module.event_notifications[0].event_notifications_private_endpoint
5151
}
5252

5353
output "event_notifications_public_endpoint" {
5454
description = "Event Notifications instance public endpoint URL"
55-
value = local.use_existing_en_instance ? null : module.event_notifications[0].event_notifications_public_endpoint
55+
value = local.use_existing_en_instance ? local.existing_en_endpoints["endpoints.public"] : module.event_notifications[0].event_notifications_public_endpoint
5656
}
5757

5858
output "next_steps_text" {

0 commit comments

Comments
 (0)