---
title: AWS SQS messaging
source: https://docs.newrelic.com/docs/workflow-automation/workflow-examples/integrations/aws-sqs
---

Send messages to AWS SQS queues using IAM role authentication.

## Prerequisites

**1. AWS IAM Role Setup**

-   An IAM role that New Relic can assume
-   The role must have permissions to send messages to SQS
-   See [Set up AWS credentials](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/set-up-aws-credentials) for configuration instructions

**2. AWS SQS Queue**

-   An existing SQS queue in the specified region

**3. Required Input Values**

-   **awsRoleArn**: The ARN of the IAM role (e.g., `arn:aws:iam::123456789012:role/NewRelicIntegrationRole`)
-   **awsQueueUrl**: The full SQS queue URL (format: `https://sqs.{region}.amazonaws.com/{account-id}/{queue-name}`)
-   **awsRegion**: (optional) defaults to `us-west-2`

## What this workflow does

-   Send message to SQS queue
-   Use AWS IAM role authentication
-   Return message ID and success status

**Key actions**: `aws.execute.api`, `(sqs.send_message)`

```yaml
name: aws_execute_api_sqs_example

workflowInputs:
  awsRoleArn:
    type: String
  awsRegion:
    type: String
    defaultValue: us-west-2
  awsQueueUrl:
    type: String

steps:
  - name: sendSqsMessage
    type: action
    action: aws.execute.api
    version: 1
    inputs:
      awsRoleArn: ${{ .workflowInputs.awsRoleArn }}
      region: ${{ .workflowInputs.awsRegion }}
      service: sqs
      api: send_message
      parameters:
        QueueUrl: "${{ .workflowInputs.awsQueueUrl }}"
        MessageBody: |
          {
            "message": "deployment is bad",
            "status": "not good"
          }
      selectors:
        - name: success
          expression: '.success'
        - name: messageId
          expression: '.response.MessageId'
```

## Related topics [#related-topics]

[REST API polling](https://docs.newrelic.com/docs/workflow-automation/workflow-examples/integrations/rest-api-polling)

Combine SQS with API polling workflows

[Deployment rollback](https://docs.newrelic.com/docs/workflow-automation/workflow-examples/advanced/deployment-rollback)

Use SQS for deployment notifications

[AWS SQS actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/aws/aws-sqs)

Learn SQS action parameters
