Provision queues - Standard/FIFO in AWS
ops.json
:ops.json
in the root directory of Github repo you’ve
connected for the service.
ops.json
here.id
- Alphanumeric string. Must be unique amongst the queues you’ve declared above. Changing this string will
replace the original queue with new one.prefix
- Alphanumeric string. Will be used as a prefix in the name of your queue. Changing this string will replace
the original queue with new queue.fifo
- Set this to true
if you need a FIFO queue. Set it to false or leave out the fifo key if you want a
standard queue instead.exports
- Set of key value pairs. Keys are the ENVIRONMENT VARS we will pass to your code / containers. Values are
the properties of the queue provisioned. See below for available properties.id
or prefix
string will replace the original queue with new one.exports
:
$name
- Name of the queue$arn
- Amazon resource name of the queue. Eg., arn:sqs:..
ops.json
at the root of the git repository, it will be processed if a corresponding service in
any of your active environment points at the same repository as source and when a deployment is triggered.
ops.json
is parsed for processing.
Resources declared in the dependencies
object will be provisioned before your code starts to run.id
are provisioned only once for the life of the service. And updated when there is a change in
one of the properties above.exports
object will be passed as enviroment variables to your service.app-role
and that which you can copy and search in AWS IAM console > Roles section. Once you find the
IAM role in IAM console, next step is to add a policy to the IAM role to give permissions for the role to access the SQS
queue your created.
<queue-arn>
with your SQS queue’s ARN.
If you create more than one queue, expand the Resource
attribute above to an array of ARN strings.
queue-var-name
environment variable to get the
name of the queue you created. This can be passed to the AWS SDK used in your code to read/write data. There is no need
to provide credentials like access key since we are having role based access control here.
That’s it! 🎉