boto3_sqs

Connection module for Amazon SQS using boto3.

Renamed from boto_sqs to boto3_sqs and rewritten to use the boto3 sqs client APIs directly via saltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

configuration:

This module accepts explicit SQS credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:

sqs.keyid: GKTADJGHEIQSXMKKRBJ08H
sqs.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

sqs.region: us-east-1

It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:
    keyid: GKTADJGHEIQSXMKKRBJ08H
    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
    region: us-east-1

Added in version 1.0.0.

saltext.boto3.modules.boto3_sqs.__virtual__()[source]

Only load if boto3 is available.

saltext.boto3.modules.boto3_sqs.exists(name, region=None, key=None, keyid=None, profile=None)[source]

Check to see if a queue exists.

name (str):

The name of the SQS queue to check for existence.

region (str, optional):

The AWS region to use when checking for the queue’s existence. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when checking for the queue’s existence.

keyid (str, optional):

The AWS secret key to use when checking for the queue’s existence.

profile (str, optional):

The AWS profile to use when checking for the queue’s existence.

CLI Example:

salt myminion boto3_sqs.exists myqueue region=us-east-1
saltext.boto3.modules.boto3_sqs.create(name, attributes=None, region=None, key=None, keyid=None, profile=None)[source]

Create an SQS queue.

name (str):

The name of the SQS queue to create.

attributes (dict, optional):

A dictionary of attributes to set on the queue.

region (str, optional):

The AWS region to use when creating the queue. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when creating the queue.

keyid (str, optional):

The AWS secret key to use when creating the queue.

profile (str, optional):

The AWS profile to use when creating the queue.

CLI Example:

salt myminion boto3_sqs.create myqueue region=us-east-1
saltext.boto3.modules.boto3_sqs.delete(name, region=None, key=None, keyid=None, profile=None)[source]

Delete an SQS queue.

name (str):

The name of the SQS queue to delete.

region (str, optional):

The AWS region to use when deleting the queue. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when deleting the queue.

keyid (str, optional):

The AWS secret key to use when deleting the queue.

profile (str, optional):

The AWS profile to use when deleting the queue.

CLI Example:

salt myminion boto3_sqs.delete myqueue region=us-east-1
saltext.boto3.modules.boto3_sqs.list_(prefix='', region=None, key=None, keyid=None, profile=None)[source]

Return a list of the names of all visible queues.

prefix (str, optional):

Only return queues with names that start with this prefix.

region (str, optional):

The AWS region to use when listing the queues. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when listing the queues.

keyid (str, optional):

The AWS secret key to use when listing the queues.

profile (str, optional):

The AWS profile to use when listing the queues.

CLI Example:

salt myminion boto3_sqs.list region=us-east-1
saltext.boto3.modules.boto3_sqs.get_attributes(name, region=None, key=None, keyid=None, profile=None)[source]

Return attributes currently set on an SQS queue.

name (str):

The name of the SQS queue to retrieve attributes for.

region (str, optional):

The AWS region to use when retrieving the queue’s attributes. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when retrieving the queue’s attributes.

keyid (str, optional):

The AWS secret key to use when retrieving the queue’s attributes.

profile (str, optional):

The AWS profile to use when retrieving the queue’s attributes.

CLI Example:

salt myminion boto3_sqs.get_attributes myqueue
saltext.boto3.modules.boto3_sqs.set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None)[source]

Set attributes on an SQS queue.

name (str):

The name of the SQS queue to set attributes for.

attributes (dict):

A dictionary of attributes to set on the queue.

region (str, optional):

The AWS region to use when setting the queue’s attributes. If not specified, the default region is used.

key (str, optional):

The AWS access key to use when setting the queue’s attributes.

keyid (str, optional):

The AWS secret key to use when setting the queue’s attributes.

profile (str, optional):

The AWS profile to use when setting the queue’s attributes.

CLI Example:

salt myminion boto3_sqs.set_attributes myqueue '{ReceiveMessageWaitTimeSeconds: 20}' region=us-east-1