generated from MITLibraries/python-lambda-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from MITLibraries/ADR
Update Lambda Handler Name
- Loading branch information
Showing
7 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### This is the Terraform-generated GitHub Actions workflow for cf-lambda ### | ||
### applications for dev/stage/prod. It will publish the Lambda zip to S3 ### | ||
### and automatically run Terraform in the Terraform Cloud ### | ||
### workloads-libraries-website-prod workspace. It will NOT auto-apply in ### | ||
### Terraform Cloud; rather, TfC will wait for human input to either cancel ### | ||
### or apply the result. ### | ||
name: Prod CF Lambda@Edge Full Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
deploy-lambda: | ||
if: github.ref == 'refs/heads/main' | ||
name: Push zip to S3 and Deploy CloudFront Distribution | ||
uses: mitlibraries/.github/.github/workflows/cf-lambda-shared-deploy.yml@main | ||
secrets: inherit | ||
with: | ||
AWS_REGION: us-east-1 | ||
ENVIRONMENT: prod | ||
GHA_ROLE: ledge-custom-domain-gha-prod | ||
TF_AUTO_APPLY: false | ||
TF_WORKSPACE: workloads-libraries-website-prod | ||
UPLOAD_ZIP: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 1. Pick the Custom Domain Lambda Handler Name | ||
|
||
Date: 2024-01-19 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
Per the AWS documentation for [Lambda function handlers in Python](https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html?icmpid=docs_lambda_help), we need to ensure that what Terraform defines for the handler when it create the Lambda function matches up with what the developer uses for a file name and function name in the dependent application repository. | ||
|
||
See ADR#8 in [mitlib-tf-workloads-libraries-website](https://github.com/MITLibraries/mitlib-tf-workloads-libraries-website) which says the exact same thing. | ||
|
||
## Decision | ||
|
||
1. The "custom domain" Lambda function handler is `handler`. | ||
2. The "custom domain" Lambda function filename in which the handler function lives is `lambda_edge.py`. | ||
|
||
The name of the handler that is used in the `resource "aws_lambda_function" "lambda_edge_custom_domain" {}` resource is `lambda_edge.handler`. | ||
|
||
## Consequences | ||
|
||
If anyone decides to rename Python files in this repo, then the definition of the Lambda function in the [mitlib-tf-workloads-libraries-website](https://github.com/MITLibraries/mitlib-tf-workloads-libraries-website) repo might need to be udpated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters