... Copyright 2016 Six Feet Up, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
title: | Using Python with AWS Lambda |
---|---|
event: | IndyPy May 2016 |
author: | Calvin Hendryx-Parker |
pygments: | tango |
css: | custom.css |
Note
Introduce yourself, why are you the person they should be listening to for the next 45 minutes
- Server-less computing
- Event-driven
- Continuous Scaling
- Python
- Java
- Node.js
- S3
- Kinesis
- DynamoDB
- SNS
- API Gateway
- Mobile Backend
- Scheduled Events
- AWS IoT
- Alexa Events
Note
Async calls use the Event invocation type and the return is discarded.
Kinesis can work sync or async and can read in batches of records coming from a stream
Lambda can subscribe to SNS topics even across accounts
More event sources are being added such as Cognito Sync Triggers
- First 1 million requests per month are free
- $0.20 per 1 million requests thereafter
- First 400,000 GB-seconds of compute time per month are free
- Lambda instances can vary based on RAM used
- For 128MB instance, you get 3.2M seconds free
- Allows up to 1.5GB instances (266,667 seconds free)
- Billing is metered in increments of 100 milliseconds
Note
All calls made to AWS Lambda must complete execution within 300 seconds
- Python 2.7
- Include Standard Library
- Includes the AWS SDK library, Boto 3
- You can bundle anything else you like
- Simple
- TTW
- No dependencies
- API Endpoint
- S3 Events
- Fetch Files
- Use Pillow to Convert Images
- Put the Converted Files Back
https://github.com/Miserlou/lambda-packages
Note
Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory
Binary compiles can be made and just need to run on Amazon Linux
- API Gateway
- Webhook Target for ZenDesk
- Use Requests to call another Webhook in Pingdom