Skip to content

Commit d96b995

Browse files
ericfitzclaude
andcommitted
feat(oci-private): add optional tmi-tf-wh OCIR repo, queue, and IAM
Mirrors oci-public configuration with is_public=false for OCIR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3cb8470 commit d96b995

3 files changed

Lines changed: 63 additions & 4 deletions

File tree

terraform/environments/oci-private/main.tf

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ resource "oci_artifacts_container_repository" "redis" {
139139
is_public = false
140140
}
141141

142+
resource "oci_artifacts_container_repository" "tmi_tf_wh" {
143+
count = var.tmi_tf_wh_enabled ? 1 : 0
144+
compartment_id = var.compartment_id
145+
display_name = "${var.name_prefix}/tmi-tf-wh"
146+
is_public = false
147+
}
148+
142149
# ---------------------------------------------------------------------------
143150
# Network Module (private subnets, NAT gateway for outbound)
144151
# ---------------------------------------------------------------------------
@@ -263,6 +270,18 @@ module "logging" {
263270
depends_on = [module.secrets, module.kubernetes]
264271
}
265272

273+
# ---------------------------------------------------------------------------
274+
# tmi-tf-wh Queue (optional — enabled when tmi_tf_wh_enabled is true)
275+
# ---------------------------------------------------------------------------
276+
resource "oci_queue_queue" "tmi_tf_wh" {
277+
count = var.tmi_tf_wh_enabled ? 1 : 0
278+
compartment_id = var.compartment_id
279+
display_name = "${var.name_prefix}-tf-wh-queue"
280+
visibility_in_seconds = 3600
281+
retention_in_seconds = 86400
282+
dead_letter_queue_delivery_count = 3
283+
}
284+
266285
# ---------------------------------------------------------------------------
267286
# Kubernetes (OKE) Module — private endpoint, internal LB
268287
# ---------------------------------------------------------------------------
@@ -302,6 +321,12 @@ module "kubernetes" {
302321
tmi_ux_enabled = var.tmi_ux_enabled
303322
tmi_ux_image_url = var.tmi_ux_image_url
304323

324+
# tmi-tf-wh Webhook Analyzer configuration (optional)
325+
tmi_tf_wh_enabled = var.tmi_tf_wh_enabled
326+
tmi_tf_wh_image_url = var.tmi_tf_wh_image_url
327+
tmi_tf_wh_queue_ocid = var.tmi_tf_wh_enabled ? oci_queue_queue.tmi_tf_wh[0].id : ""
328+
tmi_tf_wh_extra_env_vars = var.tmi_tf_wh_extra_env_vars
329+
305330
# Database configuration (private endpoint)
306331
db_username = var.db_username
307332
db_password = local.db_password
@@ -418,10 +443,17 @@ resource "oci_identity_policy" "vault_access" {
418443
name = "${var.name_prefix}-vault-access"
419444
description = "Allow TMI OKE workloads to read secrets from Vault"
420445

421-
statements = [
422-
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to read secret-family in compartment id ${var.compartment_id}",
423-
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to use keys in compartment id ${var.compartment_id}"
424-
]
446+
statements = concat(
447+
[
448+
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to read secret-family in compartment id ${var.compartment_id}",
449+
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to use keys in compartment id ${var.compartment_id}",
450+
],
451+
var.tmi_tf_wh_enabled ? [
452+
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to use queues in compartment id ${var.compartment_id} where target.queue.id = '${oci_queue_queue.tmi_tf_wh[0].id}'",
453+
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to manage queue-messages in compartment id ${var.compartment_id} where target.queue.id = '${oci_queue_queue.tmi_tf_wh[0].id}'",
454+
"Allow dynamic-group ${oci_identity_dynamic_group.tmi_oke.name} to use generative-ai-family in compartment id ${var.compartment_id}",
455+
] : []
456+
)
425457

426458
freeform_tags = local.tags
427459
}

terraform/environments/oci-private/terraform.tfvars.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ redis_image_url = "<region>.ocir.io/<namespace>/tmi/tmi-redis:latest"
127127
# acme_contact_email = "admin@example.com"
128128
# acme_directory = "production"
129129

130+
# ---------------------------------------------------------------------------
131+
# Optional: TMI-TF-WH Webhook Analyzer
132+
# ---------------------------------------------------------------------------
133+
# tmi_tf_wh_enabled = true
134+
# tmi_tf_wh_image_url = "<region>.ocir.io/<namespace>/tmi/tmi-tf-wh:latest"
135+
130136
# ---------------------------------------------------------------------------
131137
# Optional: Additional Tags
132138
# ---------------------------------------------------------------------------

terraform/environments/oci-private/variables.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,27 @@ variable "certmgr_image_url" {
287287
default = null
288288
}
289289

290+
# ---------------------------------------------------------------------------
291+
# tmi-tf-wh Webhook Analyzer (optional)
292+
# ---------------------------------------------------------------------------
293+
variable "tmi_tf_wh_enabled" {
294+
description = "Enable tmi-tf-wh webhook analyzer deployment"
295+
type = bool
296+
default = false
297+
}
298+
299+
variable "tmi_tf_wh_image_url" {
300+
description = "Container image URL for tmi-tf-wh"
301+
type = string
302+
default = null
303+
}
304+
305+
variable "tmi_tf_wh_extra_env_vars" {
306+
description = "Additional environment variables for tmi-tf-wh"
307+
type = map(string)
308+
default = {}
309+
}
310+
290311
# ---------------------------------------------------------------------------
291312
# Tags
292313
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)