Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Comandos para criar/editar/listar/remover um lambda utilizando o awscli
echo -e "
def handler(event, context):
return {
'texto': 'hello world lambda usando awscli',
}
" >> main.py
zip -qr awsclicreatelambda.zip main.py
aws lambda create-function \
--region us-east-1 \
--handler main.handler \
--runtime python3.7 \
--function-name 'awscli-create-lambda' \
--zip-file fileb://./awsclicreatelambda.zip \
--role 'PEGUE_SUA_ARN'
#Fique ligado!
#arquivo zip: Seu código lambda precisa ter menos de 10mb caso contrário precisa subir o seu codigo zip para o S3
#role: Precisamos passar a ARN da role de execução
aws lambda list-functions
aws lambda update-function-code \
--region us-east-1 \
--function-name 'awscli-create-lambda' \
--zip-file fileb://./awsclicreatelambda.zip
aws lambda invoke \
--region us-east-1 \
--function-name 'awscli-create-lambda' \
--payload '{}' \
awsclicreatelambda.output
aws lambda delete-function \
--region us-east-1 \
--function-name 'awscli-create-lambda'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.