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 Amazon EventBridge rules.

Example:

# Example automatically generated without compilation. 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) –

  • message (Optional[RuleTargetInput]) – The message to send to the queue. Must be a valid JSON text passed to the target queue. Default: the entire EventBridge 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 an EventBridge event.

Parameters
  • rule (IRule) –

  • _id (Optional[str]) –

see :see: https://docs.aws.amazon.com/eventbridge/latest/userguide/resource-based-policies-eventbridge.html#sqs-permissions

Return type

RuleTargetConfig

Attributes

queue
Return type

IQueue