Skip to content

Commit

Permalink
Use s3 bucket to store lambda code
Browse files Browse the repository at this point in the history
  • Loading branch information
feraudet committed Nov 22, 2021
1 parent a43611f commit ccfd358
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sw*
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
lambda_function_name:
description: The Lambda function name. Check the AWS docs/readme for examples.
required: true
s3_bucket:
description: S3 bucket where upload lambda zip code.
required: true
code_path:
description: Path to the code.
required: false
Expand All @@ -24,6 +27,7 @@ runs:
- ${{ inputs.lambda_layer_arn }}
- ${{ inputs.lambda_function_name }}
- ${{ inputs.code_path }}
- ${{ inputs.s3_bucket }}
branding:
icon: 'layers'
color: 'yellow'
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ publish_dependencies_as_layer(){
publish_function_code(){
echo "Deploying the code itself..."
zip -r code.zip . -x \*.git\*
aws s3 cp code.zip s3://${INPUT_S3_BUCKET}/${INPUT_LAMBDA_FUNCTION_NAME}.zip
aws lambda update-function-code --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --zip-file fileb://code.zip
}

Expand Down

0 comments on commit ccfd358

Please sign in to comment.