mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
ecr_repo_url was empty for some reason
This commit is contained in:
parent
03e7c94158
commit
1d8fbdc4a8
4 changed files with 31 additions and 10 deletions
10
.github/workflows/_deploy_lambda.yml
vendored
10
.github/workflows/_deploy_lambda.yml
vendored
|
|
@ -15,8 +15,11 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
|
||||
image_uri:
|
||||
description: "Full ECR image URI including digest"
|
||||
ecr_repo_url:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
image_digest:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
|
|
@ -59,7 +62,8 @@ jobs:
|
|||
terraform plan \
|
||||
-var="stage=${{ inputs.stage }}" \
|
||||
-var="lambda_name=${{ inputs.lambda_name }}" \
|
||||
-var="image_uri=${{ inputs.image_uri }}" \
|
||||
-var="ecr_repo_url=${{ inputs.ecr_repo_url }}" \
|
||||
-var="image_digest=${{ inputs.image_digest }}" \
|
||||
-out=lambdaplan
|
||||
|
||||
- name: Terraform Apply
|
||||
|
|
|
|||
5
.github/workflows/deploy_terraform.yml
vendored
5
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -20,8 +20,10 @@ jobs:
|
|||
|
||||
if [[ "$BRANCH" == "prod" ]]; then
|
||||
echo "stage=prod" >> "$GITHUB_OUTPUT"
|
||||
|
||||
elif [[ "$BRANCH" == "dev" ]]; then
|
||||
echo "stage=dev" >> "$GITHUB_OUTPUT"
|
||||
|
||||
else
|
||||
echo "stage=dev" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
|
@ -88,7 +90,8 @@ jobs:
|
|||
lambda_name: address2uprn
|
||||
lambda_path: infrastructure/terraform/lambda/address2UPRN
|
||||
stage: ${{ needs.determine_stage.outputs.stage }}
|
||||
image_uri: ${{ needs.address2uprn_image.outputs.ecr_repo_url }}@${{ needs.address2uprn_image.outputs.image_digest }}
|
||||
ecr_repo_url: ${{ needs.address2uprn_image.outputs.ecr_repo_url }}
|
||||
image_digest: ${{ needs.address2uprn_image.outputs.image_digest }}
|
||||
secrets:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ module "address2uprn" {
|
|||
name = "address2uprn"
|
||||
stage = var.stage
|
||||
|
||||
image_uri = var.image_uri
|
||||
image_uri = local.image_uri
|
||||
|
||||
|
||||
environment = {
|
||||
STAGE = var.stage
|
||||
|
|
|
|||
|
|
@ -3,12 +3,25 @@ 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}"
|
||||
}
|
||||
|
||||
output "resolved_image_uri" {
|
||||
value = local.image_uri
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue