mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
add lambda_service_zip and lambda_with_api_gateway terraform modules
This commit is contained in:
parent
b810d5eb60
commit
54255942f9
3 changed files with 31 additions and 7 deletions
14
.github/workflows/deploy_terraform.yml
vendored
14
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -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]
|
||||
|
|
|
|||
24
infrastructure/terraform/modules/lambda_service_zip/main.tf
Normal file
24
infrastructure/terraform/modules/lambda_service_zip/main.tf
Normal 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
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue