SqsQueue

class aws_cdk.aws_events_targets.SqsQueue(queue, *, message=None, message_group_id=None)

Bases: object

Use an SQS Queue as a target for AWS CloudWatch event rules.

Example::

# Example may have issues. See https://github.com/aws/jsii/issues/826 # publish to an SQS queue every time code is committed # to a CodeCommit repository repository.on_commit(targets.SqsQueue(queue))

__init__(queue, *, message=None, message_group_id=None)
Parameters
  • queue (IQueue) –

  • props

  • message (Optional[RuleTargetInput]) – The message to send to the queue. Must be a valid JSON text passed to the target queue. Default: the entire CloudWatch event

  • message_group_id (Optional[str]) – Message Group ID for messages sent to this queue. Required for FIFO queues, leave empty for regular queues. Default: - no message group ID (regular queue)

Return type

None

Methods

bind(rule, _id=None)

Returns a RuleTarget that can be used to trigger this SQS queue as a result from a CloudWatch event.

Parameters
  • rule (IRule) –

  • _id (Optional[str]) –

see :see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/resource-based-policies-cwe.html#sqs-permissions

Return type

RuleTargetConfig

Attributes

queue
Return type

IQueue