# 3.6.1

**Release Date:** May 21, 2026

---

## 🐛 Bug Fixes

### Terraform Modules

#### ⚠️ Fix Event Service Secret Lookup via Required `environment_short_name`

**PR:** [#708](https://github.com/saif-corp/forge/pull/708)

**Module:** `saif-event-service`

> ⚠️ **Breaking Change** — The `saif-event-service` module now requires an `environment_short_name` variable. See [Breaking Changes](#breaking-changes) for migration steps.

Fixes a runtime secret lookup failure in the `saif-event-service` Terraform module. The `local_secrets.tf` file was using `upper(var.environment)` (e.g., `PRODUCTION`) to resolve environment-specific secrets from the ADO variable library. However, library keys use the short environment name (e.g., `[PROD]primary_key`), causing lookup failures for the production environment.

The fix introduces the **required** `environment_short_name` variable and updates secret resolution to use `upper(var.environment_short_name)`, aligning the module with ADO library key naming conventions.

**Changes:**

- ✅ Added **required** `environment_short_name` variable to `saif-event-service` module (e.g., `"prod"`, `"dev"`, `"qa"`) — no default value
- ✅ `local_secrets.tf` now uses `upper(var.environment_short_name)` for environment key lookup (e.g., `[PROD]primary_key`)
- ✅ Event service project template (`event.generated.tf`) passes the new variable through to the module call
- ✅ Terraform tests updated with `environment_short_name` assertions, including a dedicated `production_secret_lookup` test case

**Benefits:**

- 🔧 Fixes runtime secret lookup failure for production environments
- 🔧 Aligns module behaviour with ADO library key naming convention (`[PROD]`, not `[PRODUCTION]`)
- 🧪 New test explicitly asserts `local.upper_environment == "PROD"` to prevent regression

---

## 🔄 Breaking Changes

### `saif-event-service` Module — Required `environment_short_name` Variable

**Impact:** All existing callers of the `saif-event-service` module.

**Change:** The `environment_short_name` variable is now **required** with no default value. Terraform plan/apply will fail without it.

**Migration:**

Add `environment_short_name` to your `saif-event-service` module block:

**Before:**

```hcl
module "event_service" {
  source  = "app.terraform.io/SAIFCorp/event-service/saif"
  version = "~> 3.6.0"

  environment = var.environment
  # ...
}
```

**After:**

```hcl
module "event_service" {
  source  = "app.terraform.io/SAIFCorp/event-service/saif"
  version = "~> 3.6.1"

  environment            = var.environment           # e.g. "production"
  environment_short_name = var.environment_short_name # e.g. "prod"  ← ADD THIS
  # ...
}
```

**Required Actions:**

1. Add `environment_short_name` input to your `saif-event-service` module block
2. Ensure `var.environment_short_name` is declared in your consuming module's `variables.tf`
3. Pass the short environment name (e.g., `"prod"`, `"dev"`, `"qa"`) matching your ADO library key prefix
4. Bump the module version constraint to `~> 3.6.1`

---

## 📋 Additional Notes

- Total commits: 2
- Files changed: 7
- Contributors: Jason Coria Corona Yue

---

### Support

- 📧 Teams Support Channel: [Support](https://teams.microsoft.com/l/channel/19%3Acb611810fb0b42b080cfff5590bdd51c%40thread.tacv2/Support?groupId=514d2dac-2d62-48ce-bf99-0fa0ce39469c&tenantId=a86cb8ed-369b-4df5-ace5-43811f6e08cf)

---
