Skip to content

Commit 372e2ce

Browse files
committed
Adding terraform stack
1 parent a64032f commit 372e2ce

File tree

14 files changed

+4857
-1
lines changed

14 files changed

+4857
-1
lines changed

feature_store/apigw_terraform/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*.tfvars
44
fs_apigw_terraform.zip
55
*.tfstate.*
6-
6+
*.tfstate
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: terraform.zip
2+
terraform.zip:
3+
zip -r fs_apigw_terraform.zip main.tf variables.tf modules
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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

Comments
 (0)