|
| 1 | +provider "oci" { |
| 2 | + disable_auto_retries = "true" |
| 3 | + region = var.region |
| 4 | +} |
| 5 | +resource "random_string" "suffix" { |
| 6 | + length = 4 |
| 7 | + special = false |
| 8 | +} |
| 9 | + |
| 10 | +locals { |
| 11 | + compartment_id = data.oci_network_load_balancer_network_load_balancer.nlb.compartment_id |
| 12 | +} |
| 13 | + |
| 14 | + |
| 15 | +data oci_network_load_balancer_network_load_balancer nlb { |
| 16 | + network_load_balancer_id = var.nlb_id |
| 17 | +} |
| 18 | + |
| 19 | +module "feature_store_gw_subnet" { |
| 20 | + source = "./modules/subnet" |
| 21 | + kubernetes_nlb_id = var.nlb_id |
| 22 | + subnet_name = "fs-gw-subnet" |
| 23 | +} |
| 24 | + |
| 25 | +module "function" { |
| 26 | + source = "./modules/function" |
| 27 | + authorized_groups = var.authorized_user_groups |
| 28 | + compartment_id = local.compartment_id |
| 29 | + ocir_path = var.function_img_ocir_url |
| 30 | + subnet_id = module.feature_store_gw_subnet.subnet_id |
| 31 | + name_suffix = random_string.suffix.id |
| 32 | + |
| 33 | +} |
| 34 | + |
| 35 | +module "api_gw" { |
| 36 | + source = "./modules/api_gw" |
| 37 | + compartment_id = local.compartment_id |
| 38 | + function_id = module.function.fn_id |
| 39 | + nlb_id = var.nlb_id |
| 40 | + subnet_id = module.feature_store_gw_subnet.subnet_id |
| 41 | +} |
| 42 | + |
| 43 | +resource oci_identity_policy feature_store_policies { |
| 44 | + description = "FEATURE STORE: Policy allowing feature store to authenticate and authorize" |
| 45 | + name = "feature_store_gw_${random_string.suffix.id}" |
| 46 | + compartment_id = var.tenancy_ocid |
| 47 | + statements = concat(module.api_gw.policies, module.function.policies) |
| 48 | + lifecycle { |
| 49 | + ignore_changes = [defined_tags["Oracle-Tags.CreatedBy"], defined_tags["Oracle-Tags.CreatedOn"]] |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | + |
| 54 | + |
0 commit comments