Sending and Receiving SQS Messages from an EC2 instance | Scribe

    Sending and Receiving SQS Messages from an EC2 instance

    • Hafeez Baig |
    • 62 steps |
    • 4 minutes
    information ordinal icon

    Refer to the following guide to learn how to use IAM in the cloud\ <https://scribehow.com/shared/Creating_an_IAM_User_and_User_Group_in_AWS_Management_Console__hWNiiXlcRJKFqYZZEJD-cg>

    1

    Sign in to **AWS Management Console** as an **IAM User** **Pre-requisite** - Ensure you have selected the AWS region closest to your location\ For this guide, we will be using us-east-2 (Ohio) as a preferred

    2

    Type **EC2** in the search bar and click on **EC2** to view the EC2 Dashboard

    information ordinal icon

    **What is an EC2 in AWS?** Amazon EC2 (Elastic Compute Cloud) is a web service that allows users to rent virtual servers on the AWS cloud, offering scalability, flexibility, and pay-as-you-go pricing.

    3

    On the EC2 dashboard click on **Instances** from the left bar to view the EC2 instances

    4

    Click on the **Launch instances** button from the top right of the page

    5

    Create an Amazon Linux EC2 Instance with the name of "**SQS Instance**"

    information ordinal icon

    Refer to this guide to learn how to create an EC2 Instance\ <https://scribehow.com/shared/AWS__Creating_your_first_EC2_Instance__Xcu7ZVCdRfWx56YVktKgbQ>

    6

    To create a new **Role**, type **IAM** in the search bar and click on **IAM** to view the IAM Dashboard

    information ordinal icon

    **What is IAM?** IAM (Identity and Access Management) is a service provided by AWS that enables users to securely control access to AWS resources by managing users, groups, and permissions.

    7

    On the IAM dashboard, on the left bar click on the **Roles**

    8

    **Roles** wizard will open, on the top right corner click on the **Create role** button

    9

    **Select trusted entity** wizard will open, select the option **AWS service**

    information ordinal icon

    **What is the Trusted Entity type?** AWS Trusted Entity Type "AWS Service" refers to granting permissions to AWS services to perform actions on your behalf.

    10

    Scroll to the **Use case** section, from the dropdown select the option **EC2**

    11

    Scroll to the **Choose a use case for the specified service** section and select the option **EC2**

    information ordinal icon

    Here we are choosing trusted entity as EC2 service, allowing EC2 instances to call AWS service on your behalf

    12

    Scroll the page and click on the **Next** button

    13

    **Add permissions** wizard will open, scroll to the **Permissions policies** section and select the Policy name **AWSLambdaSQSQueueExecutionRole**

    information ordinal icon

    **What is AWSLambdaSQSQueueExecutionRole?** AWSLambdaSQSQueueExecutionRole is an AWS IAM role used to grant permissions to Lambda functions to interact with SQS queues.