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

Commit d0f25ba

Browse files
authored
fix: added a fix for Event Notifications error ([more info](IBM-Cloud/terraform-provider-ibm#5817)). It is now required to pass a value for new input en_source_name when passing a value for en_instance_crn. There is also now an optional input en_source_description. These changes require IBM provider version >=1.71.3 (#198)
1 parent f4e7ee6 commit d0f25ba

File tree

10 files changed

+27
-8
lines changed

10 files changed

+27
-8
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-12-10T06:40:44Z",
6+
"generated_at": "2023-12-11T06:40:44Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ You need the following permissions to run this module.
6666
| Name | Version |
6767
|------|---------|
6868
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
69-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >=1.64.1, <2.0.0 |
69+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >=1.71.3, <2.0.0 |
7070
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, <1.0.0 |
7171

7272
### Modules
@@ -101,6 +101,8 @@ You need the following permissions to run this module.
101101
| <a name="input_cos_bucket"></a> [cos\_bucket](#input\_cos\_bucket) | The name of the Cloud Object Storage bucket to be used in SCC instance. Required when creating a new SCC instance. | `string` | `null` | no |
102102
| <a name="input_cos_instance_crn"></a> [cos\_instance\_crn](#input\_cos\_instance\_crn) | CRN of the Cloud Object Storage to store SCC data. Required when creating a new SCC instance. | `string` | `null` | no |
103103
| <a name="input_en_instance_crn"></a> [en\_instance\_crn](#input\_en\_instance\_crn) | The CRN of Event Notifications instance to be used with SCC. If no value is provided, Event Notifications will not be enabled for this SCC instance | `string` | `null` | no |
104+
| <a name="input_en_source_description"></a> [en\_source\_description](#input\_en\_source\_description) | Optional description to give for the Event Notifications integration source. Only used if a value is passed for `en_instance_crn`. | `string` | `null` | no |
105+
| <a name="input_en_source_name"></a> [en\_source\_name](#input\_en\_source\_name) | The source name to use for the Event Notifications integration. Required if a value is passed for `en_instance_crn`. | `string` | `null` | no |
104106
| <a name="input_existing_scc_instance_crn"></a> [existing\_scc\_instance\_crn](#input\_existing\_scc\_instance\_crn) | The CRN of an existing Security and Compliance Center instance. If not supplied, a new instance will be created. | `string` | `null` | no |
105107
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | Name of the security and compliance instance that will be provisioned by this module | `string` | n/a | yes |
106108
| <a name="input_plan"></a> [plan](#input\_plan) | Pricing plan to create SCC instance. Options include security-compliance-center-standard-plan or security-compliance-center-trial-plan | `string` | `"security-compliance-center-standard-plan"` | no |

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
ibm = {
55
source = "IBM-Cloud/ibm"
6-
version = ">= 1.66.0"
6+
version = ">= 1.71.3"
77
}
88
}
99
}

examples/complete/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ module "create_scc_instance" {
6868
cos_bucket = var.existing_scc_instance_crn == null ? module.cos[0].bucket_name : null
6969
cos_instance_crn = var.existing_scc_instance_crn == null ? module.cos[0].cos_instance_id : null
7070
en_instance_crn = module.event_notification.crn
71+
en_source_name = module.event_notification.event_notification_instance_name
7172
skip_cos_iam_authorization_policy = false
7273
attach_wp_to_scc_instance = true
7374
skip_scc_wp_auth_policy = false

examples/complete/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = ">= 1.64.1"
9+
version = ">= 1.71.3"
1010
}
1111
}
1212
}

main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ resource "time_sleep" "wait_for_scc_cos_authorization_policy" {
8383
locals {
8484
# tflint-ignore: terraform_unused_declarations
8585
validate_new_scc_instance_cos_setting = var.existing_scc_instance_crn == null && anytrue([var.cos_bucket == null, var.cos_instance_crn == null]) ? tobool("when creating a new SCC instance, both both `var.cos_instance_crn` and `var.cos_bucket` are required.") : false
86+
# tflint-ignore: terraform_unused_declarations
87+
validate_en_integration = var.en_instance_crn != null && var.en_source_name == null ? tobool("When passing a value for 'en_instance_crn', a value must also be passed for 'en_source_name'.") : false
8688
}
8789

8890
# attach a COS bucket and an event notifications instance
@@ -91,7 +93,9 @@ resource "ibm_scc_instance_settings" "scc_instance_settings" {
9193
count = var.existing_scc_instance_crn == null ? 1 : 0
9294
instance_id = resource.ibm_resource_instance.scc_instance[0].guid
9395
event_notifications {
94-
instance_crn = var.en_instance_crn
96+
instance_crn = var.en_instance_crn
97+
source_name = var.en_source_name
98+
source_description = var.en_source_description
9599
}
96100
object_storage {
97101
instance_crn = var.cos_instance_crn

modules/attachment/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "create_scc_profile_attachment " {
3838
| Name | Version |
3939
|------|---------|
4040
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
41-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >=1.64.1, <2.0.0 |
41+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >=1.71.3, <2.0.0 |
4242

4343
### Modules
4444

modules/attachment/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">=1.64.1, <2.0.0"
7+
version = ">=1.71.3, <2.0.0"
88
}
99
}
1010
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ variable "en_instance_crn" {
8585
description = "The CRN of Event Notifications instance to be used with SCC. If no value is provided, Event Notifications will not be enabled for this SCC instance"
8686
}
8787

88+
variable "en_source_name" {
89+
type = string
90+
default = null
91+
description = "The source name to use for the Event Notifications integration. Required if a value is passed for `en_instance_crn`."
92+
}
93+
94+
variable "en_source_description" {
95+
type = string
96+
default = null
97+
description = "Optional description to give for the Event Notifications integration source. Only used if a value is passed for `en_instance_crn`."
98+
}
99+
88100
variable "skip_cos_iam_authorization_policy" {
89101
type = bool
90102
default = false

version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = ">=1.64.1, <2.0.0"
9+
version = ">=1.71.3, <2.0.0"
1010
}
1111

1212
time = {

0 commit comments

Comments
 (0)