Drive Link: https://drive.google.com/drive/u/3/folders/1qi1kIUQad6aGMQsWT2ZEQTJ-bCvBfybs
Trello Link: https://trello.com/b/5hir3deU/photo-finish
Stuff you need (ask Josh):
- AWS Application Tag (for creating AWS resources/functions and linking to application)
- IAM login and password (logging into console)
- IAM public and secret access key (use AWS Swift APK)
- AWS_REGION is
us-west-1
- Create the new Lambda function on the AWS console
Ensure that the tag is properly added to the function (ask Josh for the value)
In the Runtime Settings tab, change the handler to (function_name).lambda_handler.
- Add a new Github action job to
./github/workflows/main.yml
update_lambda_test1: # Change this line
runs-on: ubuntu-latest
needs: [checkout, configure_dep]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Create test1 zip file # Change this line
run: |
cd src/lambda/test1 # Change this line
zip -r test1.zip . # Change this line
- name: Update test1 function # Change this line
run: |
aws lambda update-function-code \
--function-name test1 \ # Change this line
--zip-file fileb://src/lambda/test1/test1.zip \ # Change this line
--publish ...substituting test1 for the actual name of the Lambda function you create.
- Create the corresponding directory in
src/lambda/for your new Lambda function. Pushing your commit will update the code on AWS automatically, thanks to the GitHub action.
cd src/lambda
mkdir test1
touch test1.py
Make sure the lambda function has this name, otherwise it will not run! We will identify lambda functions by file name.
def lambda_handler(event, context):
return {
"status": 200,
"body": "Hello!"
}
