Skip to main content

Simple Queue Service (SQS)

Direction: MO & MT

This queue-based delivery mechanism is widely used for facilitating fast and reliable Message delivery between systems in AWS.

Each SQS Destination is defined by a triptic of queue handles.

(i.e. https://sqs.eu-central-1.amazonaws.com/000000000000/Data_MO):

  • MO Queue - Queue Handle to send MO Messages; as prescribed by LingoMO
  • MT Queue - Queue Handle to "listen" to for MT Messages; as prescribed by LingoMT
    • (Optional) This can be omitted if no requirement for MT messaging
  • Status Queue - Queue Handle the platform will send status updates to (i.e. delivery reports); as prescribed by LingoStatus
    • (Optional) This can be omitted if not required

Setup

As Queues reside within Customers Accounts, delegated access needs to be provided to the platform to:

  • Send Messages to the MO Queue
  • Consume Messages from the MT Queue
  • Send Messages to the Status Queue

Alternatively, simply copy and apply this CloudFormation script:

---
AWSTemplateFormatVersion: 2010-09-09
Description: "Cloudloop Data customer template for creating SQS queues"
Parameters:
CloudloopDataARN:
Description: The ARN of the Cloudloop Data Task Role
Type: String
Default: arn:aws:iam::902942185257:role/CloudloopDataAgent
MOQueueName:
Description: The name for the mobile-originated queue in SQS
Type: String
Default: Cloudloop_Data_MO
MTQueueName:
Description: The name for the mobile-terminated queue in SQS
Type: String
Default: Cloudloop_Data_MT
MTConfirmQueueName:
Description: The name for the mobile-terminated confirmation queue in SQS
Type: String
Default: Cloudloop_Data_MT_Confirm
Resources:
MOQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Ref MOQueueName
MTQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Ref MTQueueName
MTConfirmationQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Ref MTConfirmQueueName
ReceiveMTPolicy:
Type: AWS::SQS::QueuePolicy
DependsOn: MTQueue
Properties:
Queues:
- !Ref MTQueue
PolicyDocument:
Id: ReceivePolicy
Statement:
Sid: Receive
Effect: Allow
Principal:
"AWS" : !Ref CloudloopDataARN
Action:
- sqs:ReceiveMessage
- sqs:ChangeMessageVisibility
- sqs:DeleteMessage
- sqs:GetQueueAttributes
- sqs:GetQueueUrl
Resource: !GetAtt MTQueue.Arn
SendMOPolicy:
Type: AWS::SQS::QueuePolicy
DependsOn:
- MOQueue
Properties:
Queues:
- !Ref MOQueue
PolicyDocument:
Id: SendPolicy
Statement:
Sid: SendMO
Effect: Allow
Principal:
"AWS" : !Ref CloudloopDataARN
Action:
- sqs:SendMessage
- sqs:GetQueueUrl
Resource:
- !GetAtt MOQueue.Arn
SendMTConfirmationPolicy:
Type: AWS::SQS::QueuePolicy
DependsOn:
- MTConfirmationQueue
Properties:
Queues:
- !Ref MTConfirmationQueue
PolicyDocument:
Id: SendMTConfirmationPolicy
Statement:
Sid: SendMO
Effect: Allow
Principal:
"AWS" : !Ref CloudloopDataARN
Action:
- sqs:SendMessage
- sqs:GetQueueUrl
Resource:
- !GetAtt MTConfirmationQueue.Arn