Bobcares

AWS CLI SQS Create Queue: How to?

by | Aug 20, 2022

Let us take a closer look at the aws CLI SQS to create Queue in detail. With the support of AWS Support services, we can give you a detailed note on how  AWS SQS works.

AWS CLI SQS

aws cli sqs create queue

Amazon SQS is a dependable, highly scalable hosted queue used to store messages as they pass between applications or microservices. Amazon SQS allows you to disconnect distant application components by moving data across them.

The AWS Command Line Interface or AWS CLI is a centralized management tool for AWS services. A user may handle various AWS services from the command line and automate them using scripts with only one tool to download and configure. AWS CLI SQS creates a queue using AWS CLI, a user may list, create, and remove Queues, as well as send and receive messages via the terminal.

Create an SQS Queue

Make a file with the name q-attributes.json containing this information.

{
"MessageRetentionPeriod": "180"
}

Do this now, provided the machine has AWS CLI installed and configured.

aws sqs create-queue --queue-name sreeQ --attributes file://q-attributes.json

An output will open up as shown below. Keep the Q link because it is necessary for the reaming section.

{
"QueueUrl": "https://ap-south-1.queue.amazonaws.com/nnn/sreeQ"
}

To examine the SQS queue characteristics, use the following code.

aws sqs get-queue-attributes --queue-url https://ap-south-1.queue.amazonaws.com/nnn/sreeQ --attribute-names All

An output as given below will open up:

{
"Attributes": {
"QueueArn": "arn:aws:sqs:ap-south-1:nnn:sreeQ",
"ApproximateNumberOfMessages": "0",
"ApproximateNumberOfMessagesNotVisible": "0",
"ApproximateNumberOfMessagesDelayed": "0",
"CreatedTimestamp": "1540707132",
"LastModifiedTimestamp": "1540707132",
"VisibilityTimeout": "30",
"MaximumMessageSize": "262144",
"MessageRetentionPeriod": "180",
"DelaySeconds": "0",
"ReceiveMessageWaitTimeSeconds": "0"
}
}

Execute the following command to create an SQS Queue.

aws sqs create-queue --queue-name my-sqs-using-cli

It is possible to provide attributes while creating an SQS Queue; for example, to build a Queue with the parameter DelaySeconds, run the following command.

aws sqs create-queue --queue-name my-sqs-using-cli-with-attribute --tags "env"="test"
--attributes DelaySeconds=10
This is the final step in creating an SQS queue.

[Need assistance with similar queries? We are here to help]

Conclusion

To conclude, the AWS CLI SQS creates a queue using AWS CLI. And AWS CLI is an advanced management tool for SQS is a highly efficient tool to store messages.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.