Giter Club home page Giter Club logo

hands-on-aws-lambda-redis's Introduction

Hands-on - AWS Lambda + Redis

Introdução

Problema

Solução

Step 1

mkdir my-sample-lambda

Step 2

touch my-sample-lambda/app.py

Step 3

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)

Step 4

pip install --target ./my-sample-lambda/package boto3

Step 5

cd ./my-sample-lambda/package && zip -r ../my-sample-package.zip . && cd ..

Step 6

zip -g my-sample-package.zip app.py

Step 7

aws lambda update-function-code --function-name MySample_001 --zip-file fileb://my-sample-package.zip

Step 8

Criar Função Lambda

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

Atualizar Código Função Lambda

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

Referência

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

hands-on-aws-lambda-redis's People

Stargazers

Vince Fulco--Bighire.tools avatar

Watchers

James Cloos avatar Anderson Braz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.