|
| 1 | +############################################################################## |
| 2 | +# Resource Group |
| 3 | +############################################################################## |
| 4 | + |
| 5 | +module "resource_group" { |
| 6 | + source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-resource-group.git?ref=v1.0.5" |
| 7 | + # if an existing resource group is not set (null) create a new one using prefix |
| 8 | + resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null |
| 9 | + existing_resource_group_name = var.resource_group |
| 10 | +} |
| 11 | + |
| 12 | +############################################################################## |
| 13 | +# Key Protect All Inclusive |
| 14 | +############################################################################## |
| 15 | + |
| 16 | +module "key_protect_all_inclusive" { |
| 17 | + source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-key-protect-all-inclusive.git?ref=v4.0.0" |
| 18 | + key_protect_instance_name = "${var.prefix}-kp" |
| 19 | + resource_group_id = module.resource_group.resource_group_id |
| 20 | + region = var.region |
| 21 | + resource_tags = var.resource_tags |
| 22 | + key_map = { "es" = ["${var.prefix}-es"] } |
| 23 | + enable_metrics = false |
| 24 | +} |
| 25 | + |
| 26 | +############################################################################## |
| 27 | +# Events-streams-instance |
| 28 | +############################################################################## |
| 29 | + |
| 30 | +module "event_streams" { |
| 31 | + source = "../../" |
| 32 | + resource_group_id = module.resource_group.resource_group_id |
| 33 | + es_name = "${var.prefix}-es" |
| 34 | + plan = var.plan |
| 35 | + kms_key_crn = module.key_protect_all_inclusive.keys["es.${var.prefix}-es"].crn |
| 36 | + existing_kms_instance_guid = module.key_protect_all_inclusive.key_protect_guid |
| 37 | + schemas = var.schemas |
| 38 | + tags = var.resource_tags |
| 39 | + topics = var.topics |
| 40 | + service_endpoints = var.service_endpoints |
| 41 | +} |
0 commit comments