mkdir my-sample-lambda
touch my-sample-lambda/app.py
import boto3
s3 = boto3.resource('s3')
my_bucket = s3.Bucket('braz-bucket-storage')
for my_bucket_object in my_bucket.objects.all():
print(my_bucket_object)
pip install --target ./my-sample-lambda/package boto3
cd ./my-sample-lambda/package && zip -r ../my-sample-package.zip . && cd ..
zip -g my-sample-package.zip app.py
aws lambda update-function-code --function-name MySample_001 --zip-file fileb://my-sample-package.zip
aws lambda create-function --function-name MyRedisFunction --timeout 30 --memory-size 1024 --zip-file fileb://my-deployment-package.zip --handler app.handler --runtime python3.8 --role arn:aws:iam:::role/lambda-vpc-role
cd my-math-function
aws lambda update-function-code --function-name MyMathFunction --zip-file fileb://my-deployment-package.zip
aws lambda invoke --function-name MyRedisFunction output.txt
Implantar funções do Lambda em Python com arquivos .zip
Tutorial: configurar uma função do Lambda para acessar o Amazon ElastiCache em uma Amazon VPC