Python Posts

Importing AWS Resources to CDK Apps with Python

Shikisoft Blog - Importing existing AWS resources to AWS CDK stacks

In my AWS CDK with Python Step by Step course, I teach you to define your constructs from the ground up. You learn to specify your AWS resources through CDK constructs using Python’s object-oriented methods.

However, what if you need to use or reference an existing resource from your AWS account, such as a VPC? Can you import a resource to your AWS CDK app?

So, in this blog post, I will discuss how to import an existing resource as a CDK construct. But you cannot achieve this in environment-agnostic stacks. Hence, we will start with specifying targetted CDK environments for your CDK stacks.

Continue reading the Importing AWS Resources to CDK Apps with Python blog 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.

Continue reading the AWS Lambda IAM Authentication for Amazon RDS With Python: Secure, But Limited blog 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!

Continue reading the Accessing a MongoDB instance from AWS Lambda using Python blog 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.

Continue reading the Sending SMS Messages with Amazon SNS, AWS Lambda and Python blog post.