
Explore AWS SQS and SNS with Python and Boto3, learn how SNS enables mass and email notifications, and bind other applications to build decoupled pipelines.
Learn AWS SQS and SNS with Python to send and receive messages asynchronously, align with well-architected framework, and build a code-driven, decoupled architecture from scratch, automating queues, topics, and subscriptions.
Explore how to build and configure SQS queues (standard, dead-letter, and FIFO) using Python and Boto3, then set up SNS topics and subscriptions for email and SMS notifications.
Begin by setting up an AWS account with a free tier, and prepare your environment with SNS, SQS basics, Python, and the PyCharm IDE to start the course.
Prepare your development environment by installing Python and boto3, configuring AWS access keys, and exploring the AWS console; set up PyCharm, region, and credentials for secure AWS workflows.
Configure credentials and region for AWS using Python and boto3, then set up macOS, Windows, or Linux with PyCharm and virtual environments for SQS and SNS development.
Sign up for an AWS account, review the 12 months free tier, provide billing details, and verify via a phone call to start using AWS resources.
Sign in to the AWS console, switch regions, and review your account details and recent services. Learn to use cost explorer and AWS organizations for centralized control.
Create an AWS IAM user for programmatic access, attach appropriate policies, enable multi-factor authentication, and securely store the generated access key and secret key for deployment.
Install python 3.6 and pip from python.org on Windows, customize the setup to include pip and add python to PATH, then verify the installation in the command prompt.
Install the AWS CLI on Windows using the 64-bit installer and accept the license. Configure the PATH with environment variables and verify the CLI is working.
Configure the AWS CLI with your access key, secret key, and eu-central-1 region, set the default output to json, and store credentials outside Python code for boto3 use.
Verify your AWS setup by checking credentials with aws configure, confirming the access key, secret key, and region, then validate Python and Boto3 installation for SQS and SNS.
Install Python 3 and the Python package manager on macOS from Python.org, configure path and shell integration, and verify Python 3.6 and pip3.6 in the terminal.
Install aws cli on macOS with homebrew to avoid path issues and configure access keys for command-line access to AWS resources.
Configure the AWS CLI with access key and secret key, set a default region like eu-central-1, then install the boto3 library to interact with the AWS API in Python.
Install boto3 using the python package manager pip, specifically pip3.6, to set up your Python project for working with boto3 and its API.
Verify your setup by confirming Python 3.6 installation, AWS CLI configuration, and boto3 readiness, ensuring access keys, region, and output format for SQS and SNS.
Set up a PyCharm project with Python 3.6, create a src package and two files, import boto3, and define a function to get an AWS SQS client in eu-west-1.
Create an SQS queue using a boto3 client by specifying the queue name; attributes are optional, with defaults applied when omitted, and the code prints the queue URL.
Learn to create an AWS SQS fifo queue, ensuring guaranteed message delivery and proper naming with the .fifo suffix, using Python and Boto3.
Create a dead-letter queue and bind it to the main queue in AWS SQS, configuring the read-write policy and max receive count for failed messages.
Learn to locate and retrieve AWS SQS queues using Python and Boto3 by filtering with a queue name prefix or listing all queues in your region via AWS SQS API.
Learn to fetch SQS queue properties with boto3 by calling get_queue_attributes on the queue URL, requesting specific attributes or all, and view values like message count and visibility timeout.
learn to update an aws sqs queue's attributes with boto3 by passing a dict to set maximum message size to 128 kilobytes and visibility timeout to 15 seconds.
Delete an SQS queue by calling delete_queue with its URL, and note that propagation may take up to 30 seconds before the queue is fully removed.
Send a message to an SQS queue using the boto3 AWS client, supplying the queue URL, message body, and optional attributes, with delay seconds and FIFO group ID options.
Send batch messages to an AWS queue using a Python method, supplying an array of entries with unique IDs and message bodies, and verify delivery in the AWS console.
Learn how to poll an SQS queue from Python using receive_message to pull up to a specified number of messages, view message IDs and bodies, and print them for processing.
Process messages from an AWS SQS queue using polling, log IDs and bodies, safely delete processed messages with receipt handles, and recognize that polling may not return all messages.
Learn to manage SQS message processing by dynamically changing the visibility timeout with a receipt handle, ensuring safe processing in a decoupled Python workflow.
Learn how to purge an SQS queue by calling the purge queue method with the queue URL, deleting all remaining messages and verifying via the AWS console.
Create an sns topic with boto3 in python by configuring the sns client for eu-west-1 and calling create_topic with a topic name. Check the topic in the aws console.
Learn to fetch and list AWS topics using Python, leveraging list notation and next tokens for pagination, then filter and process the topics with loops.
Retrieve topic attributes for an SNS topic using boto3 by calling get_topic_attributes with the topic ARN, and view default attributes like policy and principal actions returned by AWS.
update a topic's attributes with the aws sns client by specifying the topic and attribute name, then set a new value such as display name. verify the update in console.
Delete a topic by calling the sns client’s delete_topic with the topic arn, then verify its removal in the aws console.
Create email subscriptions to an SNS topic using boto3 in Python, by defining a subscribe call with topic and email protocol, handle pending confirmation, and confirm to start receiving notifications.
Explore creating an sms subscription for an sns topic using python and boto3, calling subscribe with the sms protocol and a phone number, and noting opt-out behavior.
Create an SQS subscription to an SNS topic by passing the topic and queue into a subscription method, then verify the subscription in the AWS console.
Learn how to get topic subscriptions and list subscriptions by topic for sns topics using boto3 in aws.
Learn to list opted-out phone numbers from sns subscriptions using a boto3 sns client, handle the optional next token, and verify that no numbers are opted out.
Learn to opt out of an email subscription by listing topic subscriptions, filtering for email endpoints, and invoking unsubscribe with a simple API call in python using boto3.
Discover how to unsubscribe a phone number from an sms subscription using a reusable method, adjust the endpoint with a plus sign, and confirm the unsubscribe from the sns topic.
Explore how to opt in a phone number back to your AWS SNS subscription list, with a once-a-month opt-in limit and a simple opt-in phone number method.
Publish and receive messages with AWS SNS using Python and Boto3, publishing to a topic to reach all subscribers, including email and mobile notifications, and verify delivery through console output.
Celebrate completing this AWS SQS and SNS course, understand how decoupled architectures rely on SQS queues and SNS topics for reliable message delivery with Python and Boto3.
SQS is the very first service of AWS when it was launched in 2006.
SNS is the best way to transmit notifications and messages to either SMS, Email, SQS Queue or even other applications on AWS!
Join me in this course to learn ins-and-outs of SQS Simple Queue Service and SNS Simple Notification Service from AWS!
Let’s take a closer look at what we’re going to cover in this course step-by-step.
In this course, we’ll start of with what we’ll build throughout the course and what you need to have on your computer to follow along with me.
Don’t worry; I’ll explain everything you need very clearly and I’ll show you what you need to install and setup on your computer to work with S3. There will be two different sections for Windows and MacOS users. These sections are basically identical and show how you can prepare your computer environment to be ready to work with S3! I’ll show you how to install Python, Boto3 and configure your environments for these tools. I’ll also show you how you can create your own AWS account step-by-step and you’ll be ready to work AWS in no time!
When we’re done with preparing our environment to work AWS with Python and Boto3, we’ll start implementing our solutions for AWS.
We’ll first start off with SQS Simple Queue Service and create our very first Queue on AWS. After getting our feet wet with the API, we’ll learn how we can create FIFO or First-In-First-Out Queues on SQS! Next up is Dead-Letter Queues. Dead-Letter Queues add another layer of resiliency to your applications and helps you maintain them healthy even if your main queue is not available to process the messages. So we’ll learn how we can create ourselves a Dead-Letter Queue and then bind to our Main Queue to allow messages to keep coming in case of a failure. Then we’ll learn how to operate operations on SQS Queues like retrieving configurations updating them and so on.
Next up is the message operations on SQS! We’ll learn from publishing single messages to batch messages to our SQS Queues! Once we learn how to send them, we’ll implement Polling solution for retrieving and reading the queued messages from AWS! Then we’ll learn how to process these messages and eventually learn how to delete them from SQS once we’re ready. After that, we’ll see how to update the visibility window of messages by manipulating message visibility timeouts. And lastly, we’ll learn how to completely wipe the queue by purging it and you’ll see how easy it is!
Next stop is SNS Simple Notification Service! We’ll start by creating SNS Topics and build upon that by learning to implement operations on SNS Topics for managing them. For example, we’ll learn how to retrieve information about SNS Topics, update their configurations and eventually delete them.
Most important part of SNS comes along and that is Subscriptions! With SNS Topic Subscriptions, you can literally subscribe anything to your Topic and publish notifications and messages to them.
We’ll start by implementing an Email Subscription to an SNS Topic. And we’ll learn to confirm the SNS Topic Subscription from the received email of AWS Notifications. Next is to learn SMS Subscriptions for SNS Topics. I’ll subscribe my number and show you how easy it is to subscribe anyone to your SNS Topic! We’ll also learn to implement how to subscribe an SQS Queue to an SNS Topic. Once we’ve done that, we’ll learn how we can check opted-out subscribers by filtering and listing them. Then we’ll learn the way to opt-in a SMS subscriber back into our SNS Topic Subscription!
And when we implement all this, we’ll move on with learning to publish messages to our SNS Topic Subscribers! We’ll subscribe an Email, SMS number and a SQS Queue in the same time and then publish a message to our SNS Topic! Once we do that, we’ll verify that we receive the subscription notification from Email, SMS and SQS Queue! That’s a huge benefit of SNS Topic Subscriptions and I highly recommend you to make use of it in your applications and sevices!
Again, SQS and SNS are amazing services from AWS and there are hundreds of ways you can make use of them. Let’s not lose more time and jump right into the implementation with SQS and SNS so I’ll see you in the course!