From 8a24ddce29a6f8ac0203e86275e955c7d735dcaa Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 3 Feb 2026 16:19:56 +0000 Subject: [PATCH] added changes to template --- .../terraform/lambda/_template/main.tf | 2 +- .../terraform/lambda/_template/variables.tf | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/infrastructure/terraform/lambda/_template/main.tf b/infrastructure/terraform/lambda/_template/main.tf index a0e8eb80..32d92e00 100644 --- a/infrastructure/terraform/lambda/_template/main.tf +++ b/infrastructure/terraform/lambda/_template/main.tf @@ -4,7 +4,7 @@ module "lambda" { name = REPLACE ME #"address2uprn" for example stage = var.stage - image_uri = var.image_uri + image_uri = local.image_uri environment = { diff --git a/infrastructure/terraform/lambda/_template/variables.tf b/infrastructure/terraform/lambda/_template/variables.tf index 4c9fd47d..c0b8780d 100644 --- a/infrastructure/terraform/lambda/_template/variables.tf +++ b/infrastructure/terraform/lambda/_template/variables.tf @@ -3,13 +3,21 @@ variable "lambda_name" { description = "Logical name of the lambda (e.g. address2uprn)" } -variable "image_uri" { - type = string - description = "Full ECR image URI including digest" -} - variable "stage" { description = "Deployment stage (e.g. dev, prod)" type = string } +variable "ecr_repo_url" { + type = string + description = "ECR repository URL (no tag, no digest)" +} +variable "image_digest" { + type = string + description = "Image digest (sha256:...)" +} + + +locals { + image_uri = "${var.ecr_repo_url}@${var.image_digest}" +}