@@ -44,7 +44,7 @@ An internal SES LocalStack testing endpoint (`/_localstack/aws/ses`) is configur
44
44
- [ LocalStack CLI] ( https://docs.localstack.cloud/getting-started/installation/#localstack-cli )
45
45
- [ LocalStack Web Application account] ( https://app.localstack.cloud/sign-up ) & [ Auth Token] ( https://docs.localstack.cloud/getting-started/auth-token/ )
46
46
- [ Docker] ( https://docs.docker.com/get-docker/ )
47
- - [ Python 3.9 +] ( https://www.python.org/downloads/ ) & ` pip `
47
+ - [ Python 3.11 +] ( https://www.python.org/downloads/ ) & ` pip `
48
48
- [ AWS CLI] ( https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html ) & [ ` awslocal ` wrapper] ( https://docs.localstack.cloud/user-guide/integrations/aws-cli/#localstack-aws-cli-awslocal )
49
49
- ` jq ` , ` zip ` & ` curl `
50
50
@@ -95,11 +95,11 @@ pip install -r requirements-dev.txt
95
95
{{< /tabpane >}}
96
96
97
97
{{< callout "tip" >}}
98
- If you are encountering issues with the installation of the packages, such as Pillow, ensure you use the same version as the Python Lambdas (3.9 ) for Pillow to work.
99
- If you're using <a href =" https://github.com/pyenv/pyenv " >pyenv</a >, install and activate Python 3.9 with the following commands:
98
+ If you are encountering issues with the installation of the packages, such as Pillow, ensure you use the same version as the Python Lambdas (3.11.6 ) for Pillow to work.
99
+ If you're using <a href =" https://github.com/pyenv/pyenv " >pyenv</a >, install and activate Python 3.11 with the following commands:
100
100
{{< command >}}
101
- $ pyenv install 3.9.0
102
- $ pyenv global 3.9.0
101
+ $ pyenv install 3.11
102
+ $ pyenv global 3.11
103
103
{{< / command >}}
104
104
{{< /callout >}}
105
105
@@ -173,35 +173,35 @@ $ awslocal sns subscribe \
173
173
{{< command >}}
174
174
$ (cd lambdas/presign; rm -f lambda.zip; zip lambda.zip handler.py)
175
175
$ awslocal lambda create-function \
176
- --function-name presign \
177
- --runtime python3.9 \
178
- --timeout 10 \
179
- --zip-file fileb://lambdas/presign/lambda.zip \
180
- --handler handler.handler \
181
- --role arn:aws:iam::000000000000: role /lambda-role \
182
- --environment Variables="{STAGE=local}"
176
+ --function-name presign \
177
+ --runtime python3.11 \
178
+ --timeout 10 \
179
+ --zip-file fileb://lambdas/presign/lambda.zip \
180
+ --handler handler.handler \
181
+ --role arn:aws:iam::000000000000: role /lambda-role \
182
+ --environment Variables="{STAGE=local}"
183
183
$ awslocal lambda wait function-active-v2 --function-name presign
184
184
$ awslocal lambda create-function-url-config \
185
- --function-name presign \
186
- --auth-type NONE
185
+ --function-name presign \
186
+ --auth-type NONE
187
187
{{< / command >}}
188
188
189
189
#### Create the Image List Lambda
190
190
191
191
{{< command >}}
192
192
$ (cd lambdas/list; rm -f lambda.zip; zip lambda.zip handler.py)
193
193
$ awslocal lambda create-function \
194
- --function-name list \
195
- --handler handler.handler \
196
- --zip-file fileb://lambdas/list/lambda.zip \
197
- --runtime python3.9 \
198
- --timeout 10 \
199
- --role arn:aws:iam::000000000000: role /lambda-role \
200
- --environment Variables="{STAGE=local}"
194
+ --function-name list \
195
+ --handler handler.handler \
196
+ --zip-file fileb://lambdas/list/lambda.zip \
197
+ --runtime python3.11 \
198
+ --timeout 10 \
199
+ --role arn:aws:iam::000000000000: role /lambda-role \
200
+ --environment Variables="{STAGE=local}"
201
201
$ awslocal lambda wait function-active-v2 --function-name list
202
202
$ awslocal lambda create-function-url-config \
203
- --function-name list \
204
- --auth-type NONE
203
+ --function-name list \
204
+ --auth-type NONE
205
205
{{< / command >}}
206
206
207
207
#### Build the Image Resizer Lambda
@@ -210,7 +210,7 @@ $ awslocal lambda create-function-url-config \
210
210
{{< tab header="macOS" lang="shell" >}}
211
211
cd lambdas/resize
212
212
rm -rf libs lambda.zip
213
- docker run --platform linux/x86 * 64 -v "$PWD":/var/task "public.ecr.aws/sam/build-python3.9 " /bin/sh -c "pip install -r requirements.txt -t libs; exit"
213
+ docker run --platform linux/x86_64 -v "$PWD":/var/task "public.ecr.aws/sam/build-python3.11 " /bin/sh -c "pip install -r requirements.txt -t libs; exit"
214
214
cd libs && zip -r ../lambda.zip . && cd ..
215
215
zip lambda.zip handler.py
216
216
rm -rf libs
@@ -220,7 +220,7 @@ cd ../..
220
220
cd lambdas/resize
221
221
rm -rf package lambda.zip
222
222
mkdir package
223
- pip install -r requirements.txt -t package --platform manylinux_2_28_x86_64 --python-version 3.9 --no-deps
223
+ pip install -r requirements.txt -t package --platform manylinux_2_28_x86_64 --python-version 3.11 --no-deps
224
224
zip lambda.zip handler.py
225
225
cd package
226
226
zip -r ../lambda.zip * ;
@@ -242,19 +242,19 @@ cd ../..
242
242
243
243
{{< command >}}
244
244
$ awslocal lambda create-function \
245
- --function-name resize \
246
- --runtime python3.9 \
247
- --timeout 10 \
248
- --zip-file fileb://lambdas/resize/lambda.zip \
249
- --handler handler.handler \
250
- --dead-letter-config TargetArn=arn:aws:sns:us-east-1:000000000000: failed-resize-topic \
251
- --role arn:aws:iam::000000000000: role /lambda-role \
252
- --environment Variables="{STAGE=local}"
245
+ --function-name resize \
246
+ --runtime python3.11 \
247
+ --timeout 10 \
248
+ --zip-file fileb://lambdas/resize/lambda.zip \
249
+ --handler handler.handler \
250
+ --dead-letter-config TargetArn=arn:aws:sns:us-east-1:000000000000: failed-resize-topic \
251
+ --role arn:aws:iam::000000000000: role /lambda-role \
252
+ --environment Variables="{STAGE=local}"
253
253
$ awslocal lambda wait function-active-v2 --function-name resize
254
254
$ awslocal lambda put-function-event-invoke-config \
255
- --function-name resize \
256
- --maximum-event-age-in-seconds 3600 \
257
- --maximum-retry-attempts 0
255
+ --function-name resize \
256
+ --maximum-event-age-in-seconds 3600 \
257
+ --maximum-retry-attempts 0
258
258
{{< / command >}}
259
259
260
260
#### Connect S3 bucket to Resizer Lambda
0 commit comments