Skip to content

Latest commit

 

History

History
75 lines (64 loc) · 7.27 KB

SQS_Queues.md

File metadata and controls

75 lines (64 loc) · 7.27 KB

SQS Queues

This broker provides AWS SQS Queues. The configuration key "queues" takes a list of queue definition objects which currently supports the following fields:

Queue Definition

Name Type Required Description
name String YES Name that will be assigned to the provisioned queue
policyName String YES Name to a JSON file which represents the queue policy that will be applied to the bucket. This should be in Amazon Access Policy Language.
delaySeconds Int NO Time that messages will be delayed before delivery
maximumMessageSize Int NO Max size (in bytes) of a message sent in the queue. Default = 256kb
messageRetentionPeriod Int NO Number of seconds that SQS retains a message. Default = 4 days
receiveMessageWaitTimeSeconds Int NO Number of seconds that a ReceiveMessage action will wait for messages before returning. Default = 0 See Long Polling Documentation
visibilityTimeout Int NO Number of seconds that a message won't be available after being delivered to a recipient. Default = 30 seconds
serverSideEncryption Bool NO Indicates if server side encryption should be turned on. Default = true
kmsMasterKeyId String NO KMS Key used to encrypt messages in the queue. Default = alias/aws/sqs or null if serverSideEncryption is disabled
fifoQueue Bool NO Indicates if the queue is a FIFO queue. Default = false
redrivePolicy Object NO Indicates there should be a Dead-Letter queue created. The name of the dead-letter queue will the the name of the source queue with -dlq appended on the end. For FIFO queues, the -dlq with go before .fifo Default = null
redrivePolicy.maximumReceiveCount Int NO Number of attempted deliveries to the consumer before adding the message to the dead-letter queue. Default = 5

Example of SQS Manifest and resource policy:

App template:
template.yml

cluster:  ${ecs.cluster}
appName: herman-task-${bamboo.deploy.environment}
...
queues:
- name: herman-task-some-queue-${bamboo.deploy.environment}
  maximumMessageSize: 1024
  policyName: queue-policy.json
  redrivePolicy:
    maximumReceiveCount: 5

Corresponding policy (specified by policyName attribute):
queue-policy.json

{
    "Version": "2012-10-17",
    "Statement": [
        {
             "Action": "sqs:SendMessage",
             "Principal": {"AWS" : "arn:aws:iam::${aws.account}:role/aws-ecs/some-other-app-that-sends"},
             "Effect": "Allow",
             "Resource": "arn:aws:sqs:us-east-1:${aws.account}:herman-task-some-queue-${bamboo.deploy.environment}"
        },
        {
             "Action": "sqs:ReceiveMessage",
             "Principal": {"AWS" : "${app.iam}"},
             "Effect": "Allow",
             "Resource": "arn:aws:sqs:${aws.region}:${account.id}:herman-task-some-queue-${bamboo.deploy.environment}"
        }
         
    ]
}