add lambda_service_zip and lambda_with_api_gateway terraform modules

This commit is contained in:
Daniel Roth 2026-03-10 08:51:08 +00:00
parent b810d5eb60
commit 54255942f9
3 changed files with 31 additions and 7 deletions

View file

@ -41,7 +41,7 @@ jobs:
fi
# ============================================================
# 1 Shared Terraform (infra)
# Shared Terraform (infra)
# ============================================================
shared_terraform:
needs: determine_stage
@ -79,7 +79,7 @@ jobs:
run: terraform apply -auto-approve tfplan
# ============================================================
# 2 Build Address 2 UPRN image and Push
# Build Address 2 UPRN image and Push
# ============================================================
address2uprn_image:
needs: [determine_stage, shared_terraform]
@ -103,7 +103,7 @@ jobs:
EPC_AUTH_TOKEN: ${{ secrets.DEV_EPC_AUTH_TOKEN }}
# ============================================================
# 3 Deploy Address 2 UPRN Lambda
# Deploy Address 2 UPRN Lambda
# ============================================================
address2uprn_lambda:
needs: [address2uprn_image, determine_stage]
@ -122,7 +122,7 @@ jobs:
# ============================================================
# 2 Build Postcode Splitter image and Push
# Build Postcode Splitter image and Push
# ============================================================
postcodeSplitter_image:
needs: [determine_stage, shared_terraform]
@ -144,7 +144,7 @@ jobs:
DEV_DB_NAME: ${{ secrets.DEV_DB_NAME }}
# ============================================================
# 3 Deploy Postcode Splitter Lambda
# Deploy Postcode Splitter Lambda
# ============================================================
postcodeSplitter_lambda:
needs: [postcodeSplitter_image, determine_stage, address2uprn_lambda]
@ -283,7 +283,7 @@ jobs:
TF_VAR_google_solar_api_key: ${{ secrets.DEV_GOOGLE_SOLAR_API_KEY }}
# ============================================================
# 2 Build OrdanceSurvey image and Push
# Build OrdanceSurvey image and Push
# ============================================================
ordnanceSurvey_image:
needs: [determine_stage, shared_terraform]
@ -305,7 +305,7 @@ jobs:
DEV_DB_NAME: ${{ secrets.DEV_DB_NAME }}
# ============================================================
# 3 Deploy OrdanceSurvey Lambda
# Deploy OrdanceSurvey Lambda
# ============================================================
ordnanceSurvey_lambda:
needs: [ordnanceSurvey_image, determine_stage]

View file

@ -0,0 +1,24 @@
resource "aws_lambda_function" "this" {
function_name = var.name
role = var.role_arn
package_type = "Zip"
filename = var.filename
source_code_hash = var.source_code_hash
handler = var.handler
runtime = var.runtime
timeout = var.timeout
memory_size = var.memory_size
publish = true
environment {
variables = var.environment
}
}
output "lambda_arn" {
value = aws_lambda_function.this.arn
}
output "function_name" {
value = aws_lambda_function.this.function_name
}