@@ -17,7 +17,7 @@ awslocal sns subscribe \
1717(cd lambdas/presign; rm -f lambda.zip; zip lambda.zip handler.py)
1818awslocal lambda create-function \
1919 --function-name presign \
20- --runtime python3.9 \
20+ --runtime python3.11 \
2121 --timeout 10 \
2222 --zip-file fileb://lambdas/presign/lambda.zip \
2323 --handler handler.handler \
@@ -33,7 +33,7 @@ awslocal lambda create-function-url-config \
3333(cd lambdas/list; rm -f lambda.zip; zip lambda.zip handler.py)
3434awslocal lambda create-function \
3535 --function-name list \
36- --runtime python3.9 \
36+ --runtime python3.11 \
3737 --timeout 10 \
3838 --zip-file fileb://lambdas/list/lambda.zip \
3939 --handler handler.handler \
@@ -51,7 +51,8 @@ if [ "$os" == "Darwin" ]; then
5151 (
5252 cd lambdas/resize
5353 rm -rf libs lambda.zip
54- docker run --platform linux/x86_64 --rm -v " $PWD " :/var/task " public.ecr.aws/sam/build-python3.9" /bin/sh -c " pip install -r requirements.txt -t libs; exit"
54+ docker run --platform linux/x86_64 --rm -v " $PWD " :/var/task " public.ecr.aws/sam/build-python3.11" /bin/sh -c " pip install -r requirements.txt -t libs; exit"
55+
5556 cd libs && zip -r ../lambda.zip . && cd ..
5657 zip lambda.zip handler.py
5758 rm -rf libs
7071
7172awslocal lambda create-function \
7273 --function-name resize \
73- --runtime python3.9 \
74+ --runtime python3.11 \
7475 --timeout 10 \
7576 --zip-file fileb://lambdas/resize/lambda.zip \
7677 --handler handler.handler \
@@ -81,9 +82,10 @@ awslocal lambda create-function \
8182awslocal lambda wait function-active-v2 --function-name resize
8283awslocal lambda put-function-event-invoke-config --function-name resize --maximum-event-age-in-seconds 3600 --maximum-retry-attempts 0
8384
85+ fn_resize_arn=$( awslocal lambda get-function --function-name resize | jq -r .Configuration.FunctionArn)
8486awslocal s3api put-bucket-notification-configuration \
8587 --bucket localstack-thumbnails-app-images \
86- --notification-configuration " {\" LambdaFunctionConfigurations\" : [{\" LambdaFunctionArn\" : \" $( awslocal lambda get-function --function-name resize | jq -r .Configuration.FunctionArn ) \" , \" Events\" : [\" s3:ObjectCreated:*\" ]}]}"
88+ --notification-configuration " {\" LambdaFunctionConfigurations\" : [{\" LambdaFunctionArn\" : \" $fn_resize_arn \" , \" Events\" : [\" s3:ObjectCreated:*\" ]}]}"
8789
8890awslocal s3 mb s3://webapp
8991awslocal s3 sync --delete ./website s3://webapp
@@ -95,4 +97,5 @@ awslocal lambda list-function-url-configs --function-name presign | jq -r '.Func
9597echo " Fetching function URL for 'list' Lambda..."
9698awslocal lambda list-function-url-configs --function-name list | jq -r ' .FunctionUrlConfigs[0].FunctionUrl'
9799
98- echo " Now open the Web app under https://webapp.s3-website.localhost.localstack.cloud:4566 and paste the function URLs above (make sure to use https:// as protocol)"
100+ echo " Now open the Web app under https://webapp.s3-website.localhost.localstack.cloud:4566/"
101+ echo " and paste the function URLs above (make sure to use https:// as protocol)"
0 commit comments