pcf.particle.aws.sqs package¶
Submodules¶
pcf.particle.aws.sqs.sqs_queue module¶
-
class
pcf.particle.aws.sqs.sqs_queue.
SQSQueue
(particle_definition, session=None)¶ Bases:
pcf.core.aws_resource.AWSResource
This is the implementation of Amazon’s SQS.
-
DEFINITION_FILTER
= {'Attributes', 'QueueName', 'Tags'}¶
-
START_ATTR
= {'ApproximateNumberOfMessages', 'ApproximateNumberOfMessagesDelayed', 'ApproximateNumberOfMessagesNotVisible', 'ContentBasedDeduplication', 'CreatedTimestamp', 'DelaySeconds', 'FifoQueue', 'KmsDataKeyReusePeriodSeconds', 'KmsMasterKeyId', 'LastModifiedTimestamp', 'MaximumMessageSize', 'MessageRetentionPeriod', 'Policy', 'QueueArn', 'ReceiveMessageWaitTimeSeconds', 'RedrivePolicy', 'VisibilityTimeout'}¶
-
START_PARAM_FILTER
= {'Attributes', 'QueueName'}¶
-
UNIQUE_KEYS
= ['aws_resource.QueueName']¶
-
_set_unique_keys
()¶ Logic that sets keys from state definition that are used to uniquely identify the sqs queue
-
_set_url
(owner)¶ Used when making changes or terminating pre-existing queue handles queues created by other accounts
- Params:
- owner: queue owner’s AWS ID
Returns: void
-
_start
()¶ Starts the SQS Queue according to the desired definition
Returns: response of boto3 create_queue
-
_stop
()¶ SQS does not have a stopped state so it calls terminate
Returns: response of terminate function
-
_terminate
()¶ Terminates the Queue identified by the Queue Name and optionally the Queue Owner
Returns: response of boto3 delete_queue
-
_update
()¶ Updates any changed tags or KMS key
Returns: void
-
equivalent_states
= {<State.running: 1>: 1, <State.stopped: 2>: 0, <State.terminated: 3>: 0}¶
-
flavor
= 'sqs_queue'¶
-
get_current_definition
()¶ Uses boto calls to get the Attributes and Tags for the Queue
Returns: current definition if the queue exists, otherwise None
-
is_state_definition_equivalent
()¶ Compared the desired state and current state definition
Returns: bool
-
sync_state
()¶ Uses get_current_definition to determine whether the queue exists or not and sets the state
Returns: void
-