node-red-contrib-aws-sqs-variable 1.0.0

Node-RED nodes for AWS SQS send/receive with flexible credentials

npm install node-red-contrib-aws-sqs-variable

node-red-contrib-aws-sqs-variable

A production-ready Node-RED node for AWS SQS operations that sends and receives messages with flexible credential handling.

Features

  • ๐Ÿ“ฌ Send messages to AWS SQS
  • ๐Ÿ“ฅ Receive messages from AWS SQS
  • ๐Ÿ—๏ธ Flexible credential configuration (IAM roles, direct credentials, context variables)
  • ๐ŸŽฏ TypedInput support for dynamic Queue URL and payload
  • ๐Ÿ”„ FIFO support with Message Group and Deduplication IDs
  • ๐Ÿงพ Optional JSON parsing for received messages
  • โฑ๏ธ Built-in polling mode with status indicator
  • ๐Ÿ›ก๏ธ Production-ready with comprehensive error handling

Installation

Run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-aws-sqs-variable

After installation, restart Node-RED to load the new nodes.

Configuration

AWS Configuration Node

The module uses a configuration node that supports multiple authentication methods:

IAM Role Authentication (Recommended)

  • โœ… Use when running on EC2 instances with IAM roles
  • โœ… No credentials needed in Node-RED
  • โœ… Automatic credential rotation

Access Key Authentication

Supports multiple credential sources:

  • String: Stored securely in Node-RED credentials (encrypted)
  • Flow Context: Retrieved from flow context variables
  • Global Context: Retrieved from global context variables
  • Environment Variables: Retrieved from environment variables

Usage

Basic Usage

  1. Create AWS Configuration

    • Add an "aws-sqs-config" node
    • Configure your AWS region and credentials
  2. Add AWS SQS Node

    • Drag "aws-sqs" node to your flow
    • Select your AWS configuration
    • Choose operation: Send or Receive

Send Messages

Configure:

  • Queue URL (string, msg, flow, global, env)
  • Message Body (string, msg, flow, global, env)

Optional for FIFO:

  • Message Group ID (required for FIFO)
  • Deduplication ID (optional if content-based deduplication is enabled)

Receive Messages

Configure:

  • Queue URL
  • Max Messages (1-10)
  • Wait Time (s) (0-20, long polling)
  • Visibility Timeout (s)
  • Delete After Receive
  • Parse JSON Body (optional)

Polling:

  • Enable Polling to receive messages on a schedule
  • Set Poll Interval (s)

Input

Message Properties

  • msg.queueUrl (optional): Queue URL if not configured in node
  • msg.messageGroupId (optional): FIFO Message Group ID
  • msg.messageDeduplicationId (optional): FIFO Deduplication ID

Example Input

msg = {
  queueUrl: "https://sqs.eu-central-1.amazonaws.com/123456789012/my-queue",
  payload: { message: "Hello!" }
}

Output

Send Success Response

msg = {
  payload: {
    messageId: "abcd-1234",
    md5OfMessageBody: "e99a18c428cb38d5f260853678922e03"
  }
}

Receive Success Response

msg = {
  payload: [
    {
      MessageId: "...",
      ReceiptHandle: "...",
      Body: "raw string or parsed JSON when enabled"
    }
  ]
}

Error Response

msg = {
  payload: {
    error: "Error message"
  }
}

FIFO Notes

  • Message Group ID is required for FIFO queues
  • Deduplication ID must be unique within a 5-minute window
  • Ordering is guaranteed only within the same Message Group

Security Best Practices

  • โœ… Use IAM roles when possible (recommended for EC2 instances)
  • โœ… Store credentials in context variables rather than hardcoding
  • โœ… Use environment variables for sensitive configuration
  • โœ… Rotate access keys regularly
  • โœ… Follow the principle of least privilege
  • โœ… Enable AWS CloudTrail for audit logging

Error Handling

The node provides comprehensive error handling:

  • Configuration errors: Missing or invalid AWS configuration
  • Authentication errors: Invalid credentials or permissions
  • Queue errors: Invalid Queue URL or insufficient permissions
  • Network errors: Connection issues with AWS

All errors are logged and sent in the message payload for downstream processing.

Requirements

  • Node.js >= 12.0.0
  • Node-RED >= 2.0.0
  • AWS account with SQS access
  • Appropriate IAM permissions

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please open an issue in the project repository.

Node Info

Version: 1.0.0
Updated 1 day ago
License: MIT
Rating: 5.0 1

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • aws-sqs-config
  • aws-sqs

Keywords

  • node-red
  • aws
  • sqs
  • aws-sqs
  • queue
  • fifo
  • message-queue
  • messaging

Maintainers