@@ -27,9 +27,9 @@ module "key_protect_all_inclusive" {
2727 key_protect_instance_name = " ${ var . prefix } -kp"
2828 resource_tags = var. resource_tags
2929 keys = [{
30- key_ring_name = " en-key-ring "
30+ key_ring_name = local.key_ring_name
3131 keys = [{
32- key_name = " ${ var . prefix } -en "
32+ key_name = local.key_name
3333 force_delete = true
3434 }]
3535 }]
@@ -55,61 +55,6 @@ module "cos" {
5555 kms_encryption_enabled = false
5656}
5757
58- # #############################################################################
59- # Get Cloud Account ID
60- # #############################################################################
61-
62- data "ibm_iam_account_settings" "iam_account_settings" {
63- }
64-
65- # #############################################################################
66- # VPC
67- # #############################################################################
68- resource "ibm_is_vpc" "example_vpc" {
69- name = " ${ var . prefix } -vpc"
70- resource_group = module. resource_group . resource_group_id
71- tags = var. resource_tags
72- }
73-
74- resource "ibm_is_subnet" "testacc_subnet" {
75- name = " ${ var . prefix } -subnet"
76- vpc = ibm_is_vpc. example_vpc . id
77- zone = " ${ var . region } -1"
78- total_ipv4_address_count = 256
79- resource_group = module. resource_group . resource_group_id
80- }
81-
82- # #############################################################################
83- # Create CBR Zone
84- # #############################################################################
85-
86- module "cbr_vpc_zone" {
87- source = " terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
88- version = " 1.29.0"
89- name = " ${ var . prefix } -VPC-network-zone"
90- zone_description = " CBR Network zone representing VPC"
91- account_id = data. ibm_iam_account_settings . iam_account_settings . account_id
92- addresses = [{
93- type = " vpc" ,
94- value = ibm_is_vpc.example_vpc.crn
95- }]
96- }
97-
98- module "cbr_zone_schematics" {
99- source = " terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
100- version = " 1.29.0"
101- name = " ${ var . prefix } -schematics-zone"
102- zone_description = " CBR Network zone containing Schematics"
103- account_id = data. ibm_iam_account_settings . iam_account_settings . account_id
104- addresses = [{
105- type = " serviceRef" ,
106- ref = {
107- account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
108- service_name = " schematics"
109- }
110- }]
111- }
112-
11358# ############################################################################
11459# Create EN instance, destination, topic and subscription
11560# #############################################################################
@@ -131,34 +76,6 @@ module "event_notification" {
13176 cos_bucket_name = module. cos . bucket_name
13277 cos_instance_id = module. cos . cos_instance_crn
13378 cos_endpoint = " https://${ module . cos . s3_endpoint_public } "
134- cbr_rules = [
135- {
136- description = " ${ var . prefix } -event notification access only from vpc"
137- enforcement_mode = " enabled"
138- account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
139- rule_contexts = [{
140- attributes = [
141- {
142- " name" : " endpointType" ,
143- " value" : " public"
144- },
145- {
146- name = " networkZoneId"
147- value = module.cbr_vpc_zone.zone_id
148- }]
149- }, {
150- attributes = [
151- {
152- " name" : " endpointType" ,
153- " value" : " public"
154- },
155- {
156- name = " networkZoneId"
157- value = module.cbr_zone_schematics.zone_id
158- }]
159- }]
160- }
161- ]
16279}
16380
16481resource "ibm_en_destination_webhook" "webhook_destination" {
0 commit comments