Skip to content

Commit 7632295

Browse files
fix: get endpoint outputs directly from instance(#574)
1 parent 4e26a1c commit 7632295

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

main.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ locals {
2020
# Get account ID
2121
account_id = ibm_resource_instance.en_instance.account_id
2222

23-
# temporary workaround until https://github.ibm.com/Notification-Hub/adopters/issues/150 is implemented
24-
# Get public/private endpoint
25-
en_private_endpoint = "https://private.${var.region}.event-notifications.cloud.ibm.com"
26-
en_public_endpoint = "https://${var.region}.event-notifications.cloud.ibm.com"
23+
en_endpoints = { for key, value in ibm_resource_instance.en_instance.extensions : key => value
24+
}
2725
}
2826

2927
resource "ibm_resource_instance" "en_instance" {

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ output "service_credentials_object" {
3636

3737
output "event_notifications_private_endpoint" {
3838
description = "Instance private endpoint URL"
39-
value = local.en_private_endpoint
39+
value = local.en_endpoints["endpoints.private"]
4040
}
4141

4242
output "event_notifications_public_endpoint" {
4343
description = "Instance public endpoint URL"
44-
value = local.en_public_endpoint
44+
value = local.en_endpoints["endpoints.public"]
4545
}

0 commit comments

Comments
 (0)