diff --git a/solutions/instances/main.tf b/solutions/instances/main.tf index fef51340..18001eaf 100644 --- a/solutions/instances/main.tf +++ b/solutions/instances/main.tf @@ -257,6 +257,8 @@ module "scc_wp" { locals { parsed_existing_en_instance_crn = var.existing_en_crn != null ? split(":", var.existing_en_crn) : [] existing_en_guid = length(local.parsed_existing_en_instance_crn) > 0 ? local.parsed_existing_en_instance_crn[7] : null + en_topic = var.prefix != null ? "${var.prefix} - SCC Topic" : "SCC Topic" + en_subscription_email = var.prefix != null ? "${var.prefix} - Email for Security and Compliance Center Subscription" : "Email for Security and Compliance Center Subscription" } data "ibm_en_destinations" "en_destinations" { @@ -267,7 +269,7 @@ data "ibm_en_destinations" "en_destinations" { resource "ibm_en_topic" "en_topic" { count = var.existing_en_crn != null ? 1 : 0 instance_guid = local.existing_en_guid - name = "SCC Topic" + name = local.en_topic description = "Topic for SCC events routing" sources { id = local.scc_instance_crn @@ -281,7 +283,7 @@ resource "ibm_en_topic" "en_topic" { resource "ibm_en_subscription_email" "email_subscription" { count = var.existing_en_crn != null && length(var.scc_en_email_list) > 0 ? 1 : 0 instance_guid = local.existing_en_guid - name = "Email for Security and Compliance Center Subscription" + name = local.en_subscription_email description = "Subscription for Security and Compliance Center Events" destination_id = [for s in toset(data.ibm_en_destinations.en_destinations[count.index].destinations) : s.id if s.type == "smtp_ibm"][0] topic_id = ibm_en_topic.en_topic[count.index].topic_id diff --git a/tests/pr_test.go b/tests/pr_test.go index 204ad92f..a7096ba0 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -177,6 +177,7 @@ func TestRunUpgradeInstances(t *testing.T) { }) options.TerraformVars = map[string]interface{}{ + "prefix": options.Prefix, "resource_group_name": options.Prefix, "existing_kms_instance_crn": permanentResources["hpcs_south_crn"], "kms_endpoint_type": "public", @@ -240,6 +241,7 @@ func TestRunExistingResourcesInstances(t *testing.T) { ImplicitRequired: false, Region: region, TerraformVars: map[string]interface{}{ + "prefix": prefix, "cos_region": region, "scc_region": region, "resource_group_name": terraform.Output(t, existingTerraformOptions, "resource_group_name"), @@ -266,6 +268,7 @@ func TestRunExistingResourcesInstances(t *testing.T) { // Do not hard fail the test if the implicit destroy steps fail to allow a full destroy of resource to occur ImplicitRequired: false, TerraformVars: map[string]interface{}{ + "prefix": prefix, "cos_region": region, "scc_region": region, "resource_group_name": terraform.Output(t, existingTerraformOptions, "resource_group_name"),