From 440165dc2d9ab475346af3fc67c245291161b2e9 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 3 Feb 2026 20:03:25 +0000 Subject: [PATCH] better logs --- .../terraform/lambda/_template/README.md | 41 +++++-------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/infrastructure/terraform/lambda/_template/README.md b/infrastructure/terraform/lambda/_template/README.md index 2c3ddd43..a7282fc9 100644 --- a/infrastructure/terraform/lambda/_template/README.md +++ b/infrastructure/terraform/lambda/_template/README.md @@ -5,12 +5,6 @@ cp -r lambda/_template lambda/ -- Update `variables.tf` if required -- Ensure the Terraform module accepts: - - `lambda_name` - - `stage` - - `image_uri` - --- ### 2. Add infrastructure prerequisites (shared stack) @@ -18,12 +12,10 @@ infrastructure/terraform/shared/main.tf -- Apply the shared stack (or let CI apply it on `prod`) -- Verify the ECR repository exists in AWS +- Apply the shared stack + - This requires commenting 'if env.stage == "prod"' in .github/workflows/deploy_terraform.yml -Note: -No Terraform outputs are required for the ECR repo. -The CI pipeline resolves the repository URL dynamically at build time. +- Verify the ECR repository exists in AWS --- @@ -36,11 +28,6 @@ The CI pipeline resolves the repository URL dynamically at build time. ### 4. Wire the Lambda deploy job (CI) - Add a deploy job using `_deploy_lambda.yml` -- Pass the following inputs: - - `lambda_name` - - `lambda_path` - - `stage` - - `image_uri` (constructed as `repo@sha256:digest`) - Ensure the deploy job depends on the image build job --- @@ -49,24 +36,16 @@ The CI pipeline resolves the repository URL dynamically at build time. - Push changes to GitHub - CI will: 1. Build and push the Docker image - 2. Resolve the image digest - 3. Deploy the Lambda using the immutable `image_uri` - + 2. Deploy the Lambda + 3. Verify everything deployed. Good things to check: + - ECR with image + - SQS + - Trigger SQS + - Cloud watch logs --- ### 5. Delete 1. Delete README if you used cp -r --- -## Notes -- Terraform remote state is not used for image wiring -- Image tags are not used; deployments are digest-based -- By default, the template wires SQS → Lambda - To change this, update the Terraform in `lambda/` - (e.g. EventBridge, API Gateway, direct invoke) - ---- - -## Rule of thumb -CI decides what image to deploy. -Terraform only deploys it. +## Please feel free to update this document to make it easier for the next person \ No newline at end of file