This post shows variable small examples of Lambda functions to demonstrate how you can do with Lambda. The choice of language is Python but it is easy to migrate to other programming languages.
Continue reading “[AWS] Lambda with Python”Tag Archives: Lambda
[AWS Lab] Scheduled Lambda Invocation – EventBridge
In this lab, we will learn how to periodically invoke a lambda function via Amazon EventBridge.
Overview
- Source: EventBridge
- Build a custom Rule – Scheduling
- Target: Lambda – Function
- returns the current date time
- Python
[AWS Lab] WAF – Rate-baed Rule
In this lab, we will learn how to block traffic through WAF.
- API Gateway – REST API
- Route: GET /greet
- Lambda – Function
- Return the greeting message
- Python
- WAF
- Set up the rate-based rule
- Link to the API
[AWS Lab] Lambda – /tmp Space
In this lab, we will learn how to use local transient cache (/tmp) folder in a Lambda function.
- Overview
- S3
- Create a bucket
- Upload a configuration file
- Lambda – Function
- Retrieves the configuration file from S3 or /tmp
- Python, boto3
[AWS Lab] Lambda – Environment Variables
In this lab, we will learn how to use environment variables in a Lambda function.
Overview
- S3
- Create a bucket
- Upload an image file
- Lambda – Function
- Get the bucket name and the image name from environment variables
- Retrieves the object properties
- Python, boto3
[AWS Lab] Lambda Invocation via Polling – DynamoDB Stream
In this lab, we will learn how a lambda function can be invoked via Polling.
- Overview
- Source: DynamoDB Stream
- Create a DynamoDB Table
- Enable the Stream
- Target: Lambda – Function
- logs the received message
- does not return any value
- configures the trigger
- Python
[AWS Lab] Asynchronous Lambda Invocation – EventBridge
In this lab, we will learn how to invoke a lambda function asynchronously from Amazon EventBridge.
Overview
- Source: EventBridge
- Build a custom event Bus and add a custom event Rule
- Target: Lambda – Function
- logs the received event
- does not return any value
- Python
[AWS Lab] Lambda Invocation via Polling – SQS
In this lab, we will learn how a lambda function can be invoked via Polling.
- Overview
- Source: SQS
- Create a queue and a dead-letter queue (DLQ)
- Target: Lambda – Function
- logs the received message
- does not return any value
- configures the trigger
- Python
