This lab walks you through creation and subscription of SNS Topic. You will also create an S3 bucket and configure event notification.
You will be creating the above resources using terraform and testing it in console.
Duration: 45 minutes
AWS Region: US East (N. Virginia) us-east-1
SNS stands for Simple Notification Service.
Provides a low-cost infrastructure for the mass delivery of messages, predominantly to mobile users.
SNS acts as a single message bus that can message to a variety of devices and platforms.
SNS uses the publish/subscribe model for push delivery of messages.
SNS enables us to decouple microservices, distributed systems, and serverless applications using fully managed pub/sub.
Publishers communicate asynchronously with subscribers by producing and sending a message to a topic, which is a logical access point and communication channel.
Subscribers i.e., web servers, email addresses, SQS queues etc., consume or receive the message or notification over one of the supported protocols when they are subscribed to the topic.
Recipients subscribe to one or more "topics" within SNS.
Using SNS topics, the publisher systems can fan out messages to a large number of subscriber endpoints for parallel processing, including Amazon SQS queues, AWS Lambda functions, and HTTP/S webhooks.
SNS is reliable in delivering messages with durability.
SNS can help in automatically scale the workload.
Using topic policies, you can keep messages private and secure.
S3 stands for Simple Storage Service.
It provides object storage through a web service interface.
Each object is stored as a file with its metadata included and is given an ID number.
Objects uploaded to S3 are stored in containers called “Buckets”, whose names are globally unique. They organize the Amazon S3 namespace at the highest level.
Amazon S3 creates buckets in the region you specify.
You can assign permissions to these buckets to provide or restrict data transactions.
Applications use this ID number to access an object.
Developers can access an object via a REST API.
S3 supports upload of objects.
It uses the same scalable storage infrastructure that Amazon.com uses to run its global e-commerce network.
It's designed for storing online backup and archiving of data and applications on AWS.
Storage classes provided are:
Standard_IA i.e., Standard Infrequent Access
RRS i.e., Reduced Redundancy Storage (Not recommended by AWS)
Data access is provided through the S3 Console.
Data stored can be either Public or Private based on user requirement.
Data stored can be encrypted.
We can define life-cycle policies which can help in automation of data transfer, retention and deletion.
It is an open-source IaaC (Infrastructure as a Code) software tool where you define and create resources using providers in the declarative configuration language example JSON.
With Terraform, You can package and reuse the code in the form of modules.
It supports a number of cloud infrastructure providers such as AWS, Azure, GCP, IBM Cloud, OCI, etc.
Terraform has four major commands:
Install Terraform in your local machine using this official guide by Hashicorp.
To install Terraform using CLI, use this guide https://learn.hashicorp.com/tutorials/terraform/install-cli
To install Terraform by downloading, use this guide https://www.terraform.io/downloads.html
Download and Install Visual Studio code editor using this guide https://code.visualstudio.com/download
Setup Visual Studio Code.
Create a Variables file.
Create SNS, S3 and its components in main.tf file
Create an Output file.
Confirm the installation of Terraform by checking the version.
Apply Terraform configurations.
Check the resources in AWS Console.
Upload an object into S3 bucket and test the SNS notification.
Validation of the lab.
Clean up AWS Resources.