https://github.com/rebus-org/rebus.amazonsqs
:bus: Amazon SQS transport for Rebus
https://github.com/rebus-org/rebus.amazonsqs
amazon-s3 amazon-sqs rebus transport
Last synced: 27 days ago
JSON representation
:bus: Amazon SQS transport for Rebus
- Host: GitHub
- URL: https://github.com/rebus-org/rebus.amazonsqs
- Owner: rebus-org
- License: other
- Created: 2016-08-30T21:12:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T08:38:27.000Z (about 1 year ago)
- Last Synced: 2025-04-02T20:11:56.886Z (about 2 months ago)
- Topics: amazon-s3, amazon-sqs, rebus, transport
- Language: C#
- Homepage: https://mookid.dk/category/rebus
- Size: 3.14 MB
- Stars: 19
- Watchers: 5
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rebus.AmazonSQS
[](https://www.nuget.org/packages/Rebus.AmazonSQS)
Provides an [Amazon SQS](https://aws.amazon.com/sqs/) transport for [Rebus](https://github.com/rebus-org/Rebus).

---
## Usage
Using bare-bones Rebus with the built-in container adapter, you would do something like this:
```csharp
using var activator = new BuiltinHandlerActivator();Configure.With(activator)
.Transport(t => t.UseAmazonSQS(accessKeyId, accessKey, regionEndpoint, queueName))
.Start();Console.ReadLine();
```but for most apps, it would probably be more appropriate to use Microsoft.Extensions.Hosting and Rebus.ServiceProvider and do this:
```csharp
services.AddRebus(
configure => configure
.Transport(t => t.UseAmazonSQS(accessKeyId, accessKey, regionEndpoint, queueName))
);
```---
## Required AWS security policies
The policy required for receiving messages from a SQS queue using "least-privilege principle" is as follows:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:DeleteMessage",
"sqs:GetQueueUrl",
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessageBatch",
"sqs:SendMessageBatch",
"sqs:SendMessage",
"sqs:ReceiveMessage",
"sqs:DeleteQueue",
"sqs:CreateQueue",
"sqs:SetQueueAttributes"
],
"Resource": "[Your SQS incoming queue and DLQ arn here]"
}
]
}
```
Note that the last three actions(`sqs:DeleteQueue`, `sqs:CreateQueue` and `sqs:SetQueueAttribute`) is only required if `AmazonSQSTransportOptions.CreateQueue` is set to `true`, otherwise they could/should be omitted. It is the default behaviour that CreateQueue is set to true, hence they are included in the above ACL.To be able to send to a queue the following permissions are required on the target queue:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:GetQueueUrl",
"sqs:SendMessageBatch",
],
"Resource": "[Your SQS outgoing target queue arn here]"
}
]
}
```