AWS Lambda Posts

3 Ways to Schedule AWS Lambda and Step Functions State Machine Executions

Scheduling AWS Lambda and Step Functions Executions

In addition to API development, AWS Lambda has many use cases. One of them is running some background jobs in scheduled intervals. Besides, if you need a chain of sequential or parallel AWS Lambda functions, the ideal way to orchestrate them is using AWS Step Functions.

In this post, I will talk about how to schedule your AWS Lambda functions or Step Functions state machine executions using AWS CloudWatch and EventBridge consoles as well as AWS Serverless Application Model (SAM) and CloudFormation templates. Read more at 3 Ways to Schedule AWS Lambda and Step Functions State Machine Executions post.

AWS Lambda IAM Authentication for Amazon RDS With Python: Secure, But Limited

Amazon RDS Iam Authentication

Where do you keep your DB credentials in your AWS Lambda functions that you use to access your Amazon RDS databases? Hardcoded? No! Environment variables? Well, you might be using AWS Secrets Manager, right? It would be great! But did you know that you can also use the IAM role of your AWS Lambda function and its temporary credentials to do this?

Yes, there are different ways to manage your database credentials in your AWS Lambda functions. In this post, I will talk about one of the most secure methods, using IAM authentication of Amazon RDS, with an example of an AWS Lambda function developed in Python. I will use an Amazon RDS - MySQL DB instance, but IAM authentication is also supported on PostgreSQL DB instances as well. Read more at AWS Lambda IAM Authentication for Amazon RDS With Python: Secure, But Limited post.

Serverless APIs With Ruby, AWS Lambda & AWS SAM CLI: Accessing Amazon RDS

Using Ruby for AWS Lambda and Creating a Serverless API to Access Amazon RDS MySQL

Having a Ruby on Rails background, I got excited to try Ruby to code my AWS Lambda functions when its support for AWS Lambda was announced at Re:Invent 2018. Finally, to try Ruby on AWS Lambda, I developed a simple API using AWS Serverless Application Model (SAM) to access an Amazon RDS MySQL database. I wanted to compare it with my experiences of doing this with Python and Node.js.

Although it may seem simple, installing mysql2 gem as a dependency proved itself to be challenging than others, because it has native extensions and depends on the environment you use bundler. As always, Docker simplifies our job by providing a similar environment that our AWS Lambda function runs inside.

In this post, I will make an introduction to AWS SAM CLI and using Ruby for AWS Lambda functions. Let’s begin! Read more at Serverless APIs With Ruby, AWS Lambda & AWS SAM CLI: Accessing Amazon RDS post.

Accessing a MongoDB instance from AWS Lambda using Python

Accessing MongoDB from AWS Lambda using Python

In recent days, I made some trials for connecting to MongoDB databases from AWS Lambda functions using Python. In today’s post I will share my experiences with you and take some notes about these trials for future reference. We will install MongoDB on an EC2 instance and develop simple Python functions to access it. Let’s start! Read more at Accessing a MongoDB instance from AWS Lambda using Python post.

Sending SMS Messages with Amazon SNS, AWS Lambda and Python

Did you know that you can send SMS messages easily with Amazon SNS without subscribing any phone numbers to a topic? Let’s say that you have verified phone numbers and you would like to send text messages to them assuming that they opted in for this. Besides, you would like to pay only when you send. You can use Amazon SNS SDK for Python and automate this process using AWS Lambda. Read more at Sending SMS Messages with Amazon SNS, AWS Lambda and Python post.