Previous Topic

Next Topic

Book Contents

Book Index

Executing an AWS SQS job using the command line

This example shows how to execute an AWS SQS job using the command line.

To execute an AWS SQS job using the command line:

  1. Download and install Python 3.6.x from https://www.python.org/downloads.
  2. Download and install the AWS CLI tool from https://docs.aws.amazon.com/cli/latest/userguide/installing.html.
  3. Extract the AWS CLI to a new folder.
  4. Open a command prompt, go to the AWS CLI folder and install it by typing the following command:

    python setup.py install

  5. Configure AWS CLI by running the following command:

    aws configure

    NOTE: Type the access ID key, secret key, default region and format, when prompted. Enter the Region based on where your created queue. For example, when creating the BMC-WJM-Q1 in eu-central-1 region, enter eu-central-1 for the default region.

  6. Assuming you have an existing queue created, create a queue command, as described in https://docs.aws.amazon.com/cli/latest/reference/sqs/index.html.

    EXAMPLE: For the send-message command, execute the following command (run it via OS job or batch job):

    aws sqs send-message --queue-url https://sqs.eu-central-1.amazonaws.com/302634334388/BMC-WJM-Q1 --message-body "Hello world, this is a first AWS SQS message test from Irvine"

Parent Topic

AWS SQS job execution