Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Use the Send SQS Message action to relay Bamboo tasks and notifications, Jira workflow transitions and Jira Service Management automation rule executions via the Amazon Simple Queue (SQS), a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications:

SQS offers two types of message queues. Standard queues offer maximum throughput, best-effort ordering, and at-least-once delivery. SQS FIFO queues are designed to guarantee that messages are processed exactly once, in the exact order that they are sent.

Integrations

You can use the Send SQS Message action with the following integrations:

Requirements

The Send SQS Message action requires sufficient IAM permissions - an adequate IAM policy similar to the one provisioned by the Automation with AWS (Core) CloudFormation template might look as follows:

 Click here to expand...
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "sqs:GetQueueAttributes",
                "sqs:ListQueues",
                "sqs:SendMessage"
            ],
            "Resource": "*",
            "Effect": "Allow",
            "Sid": "SQSSendMessageAndDiscoverQueues"
        }
    ]
}

(lightbulb) Refer to Using Identity-Based (IAM) Policies for Amazon SQS for details on how to create more granular/secure policies, including a few Basic Amazon SQS Policy Examples.

Configuration

To configure a Send SQS Message action:

Complete the following settings:

Parameters

Specify the action parameters according to the following skeleton in JSON format – refer to sqs . send-message for details:

A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:

#x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF

Any characters not included in this list will be rejected. For more information, see the W3C specification for characters.

You can inject contextual variables into the remote action payload, refer to Entity Variables for details.

Send SQS Message skeleton

{
    "QueueUrl": "",
    "MessageBody": "",
    "DelaySeconds": 0,
    "MessageAttributes": {
        "KeyName": {
            "StringValue": "",
            "BinaryValue": null,
            "StringListValues": [
                ""
            ],
            "BinaryListValues": [
                null
            ],
            "DataType": ""
        }
    },
    "MessageDeduplicationId": "",
    "MessageGroupId": ""
}

Entity Variables

You can inject contextual variables with workflow entities into the remote action payload template – currently available entities are:

Examples

  • Page:
    Send SQS Message - raw text payload — This parameters template demonstrates the Send SQS Message action:

    Send SQS Message parameters example (raw text payload)

    {
      "QueueUrl": "https://sqs.ap-southeast-2.amazonaws.com/123456789012/sample-AutomationWithAWSQuickstartSQSQueue-1NAIZP8U9XJ1X",
      "MessageBody": "Automation with AWS: $event.simpleName with trace ID $event.traceId triggered at $event.timestamp - see ${bamboo.resultsUrl} for details."
    }
  • Page:
    Send SQS Message - structured JSON payload — This parameters template demonstrates the Send SQS Message action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Send SQS Message parameters example (Atlassian Workflow Event – escaped manually)

    {
      "QueueUrl": "https://sqs.ap-southeast-2.amazonaws.com/123456789012/sample-AutomationWithAWSQuickstartSQSQueue-1NAIZP8U9XJ1X",
      "MessageBody": "{ \"event\": \"$event.simpleName\", \"timestamp\": \"$event.timestamp\", \"traceId\": \"$event.traceId\" }"
    }

    Send SQS Message parameters example (Atlassian Workflow Event – escaped with utility function)

    {
      "QueueUrl": "https://sqs.ap-southeast-2.amazonaws.com/123456789012/sample-AutomationWithAWSQuickstartSQSQueue-1NAIZP8U9XJ1X",
      "MessageBody": "$util.escapeJson('{
        "event": "$event.simpleName",
        "timestamp": "$event.timestamp",
        "traceId": "$event.traceId"
      }')"
    }

How-to Articles

Filter by label

There are no items with the selected labels at this time.

Frequently Asked Questions (FAQ)

Atlassian account required

Due to a regression within Questions for Confluence Cloud, you need to log in with your Atlassian ID (or sign up for a new account) to access these automatically curated FAQs (refer to UAA-312 for the background).

  • No labels