Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit f15ef01

Browse files
authored
fix: attaching an event notification instance located in a different region fails (#243)
1 parent 4ceec2e commit f15ef01

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

solutions/instances/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This solution supports provisioning and configuring the following infrastructure
1717

1818
| Name | Version |
1919
|------|---------|
20-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
20+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.4.0 |
2121
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.3 |
2222
| <a name="requirement_time"></a> [time](#requirement\_time) | 0.12.1 |
2323

solutions/instances/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,12 @@ module "existing_en_crn_parser" {
348348
locals {
349349
existing_en_guid = var.existing_en_crn != null ? module.existing_en_crn_parser[0].service_instance : null
350350
en_topic = var.prefix != null ? "${var.prefix} - SCC Topic" : "SCC Topic"
351+
existing_en_region = var.existing_en_crn != null ? module.existing_en_crn_parser[0].region : null
351352
en_subscription_email = var.prefix != null ? "${var.prefix} - Email for Security and Compliance Center Subscription" : "Email for Security and Compliance Center Subscription"
352353
}
353354

354355
data "ibm_en_destinations" "en_destinations" {
356+
provider = ibm.en
355357
count = var.existing_en_crn != null ? 1 : 0
356358
instance_guid = local.existing_en_guid
357359
}
@@ -364,6 +366,7 @@ resource "time_sleep" "wait_for_scc" {
364366
}
365367

366368
resource "ibm_en_topic" "en_topic" {
369+
provider = ibm.en
367370
count = var.existing_en_crn != null && var.existing_scc_instance_crn == null ? 1 : 0
368371
depends_on = [time_sleep.wait_for_scc]
369372
instance_guid = local.existing_en_guid
@@ -379,6 +382,7 @@ resource "ibm_en_topic" "en_topic" {
379382
}
380383

381384
resource "ibm_en_subscription_email" "email_subscription" {
385+
provider = ibm.en
382386
count = var.existing_en_crn != null && var.existing_scc_instance_crn == null && length(var.scc_en_email_list) > 0 ? 1 : 0
383387
instance_guid = local.existing_en_guid
384388
name = local.en_subscription_email

solutions/instances/provider.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ provider "ibm" {
2121
region = var.cos_region
2222
visibility = var.provider_visibility
2323
}
24+
25+
provider "ibm" {
26+
alias = "en"
27+
ibmcloud_api_key = var.ibmcloud_api_key
28+
region = local.existing_en_region
29+
visibility = var.provider_visibility
30+
}

solutions/instances/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.3.0"
2+
required_version = ">= 1.4.0"
33
# Lock DA into an exact provider version - renovate automation will keep it updated
44
required_providers {
55
ibm = {

0 commit comments

Comments
 (0)