Skip to content

Commit

Permalink
minor polishings in Makefile, add .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
whummer committed Feb 8, 2024
1 parent e142d1f commit 5c0a1d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


.DS_Store
3 changes: 3 additions & 0 deletions lambda-snowpark-connector/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libs/
build/
output.txt
22 changes: 13 additions & 9 deletions lambda-snowpark-connector/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
install:
usage: ## Show this help
@grep -Fh "##" $(MAKEFILE_LIST) | grep -Fv fgrep | sed -e 's/:.*##\s*/##/g' | awk -F'##' '{ printf "%-25s %s\n", $$1, $$2 }'

install: ## Install dependencies
pip3 install \
--platform manylinux2010_x86_64 \
--implementation cp \
--only-binary=:all: --upgrade \
--target . \
--target ./libs \
snowflake-connector-python==2.7.9 boto3==1.26.153 botocore==1.29.153

zip:
zip -r function-py.zip .

create-function:
zip: ## Create the Lambda zip archive
mkdir -p build
cp -r libs/* build/
(cd build && zip -q -r function-py.zip .)

create-function: ## Create the Lambda function in LocalStack
awslocal lambda create-function \
--function-name localstack-snowflake-lambda-example \
--runtime python3.10 \
--timeout 180 \
--zip-file fileb://function-py.zip \
--zip-file fileb://build/function-py.zip \
--handler handler.lambda_handler \
--role arn:aws:iam::000000000000:role/lambda-role

local-invoke:
local-invoke: ## Invoke the Lambda locally
awslocal lambda invoke --function-name localstack-snowflake-lambda-example \
--cli-binary-format raw-in-base64-out \
--payload '{"body": "test" }' output.txt

start-localstack:
Expand Down

0 comments on commit 5c0a1d4

Please sign in to comment.