QueueHook

class aws_cdk.aws_autoscaling_hooktargets.QueueHook(queue)

Bases: object

Use an SQS queue as a hook target.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_autoscaling_hooktargets as autoscaling_hooktargets
from aws_cdk import aws_sqs as sqs

# queue: sqs.Queue

queue_hook = autoscaling_hooktargets.QueueHook(queue)
Parameters:

queue (IQueue) –

Methods

bind(_scope, *, lifecycle_hook, role=None)

If an IRole is found in options, grant it access to send messages.

Otherwise, create a new IRole and grant it access to send messages.

Parameters:
  • _scope (Construct) –

  • lifecycle_hook (LifecycleHook) – The lifecycle hook to attach to. [disable-awslint:ref-via-interface]

  • role (Optional[IRole]) – The role to use when attaching to the lifecycle hook. [disable-awslint:ref-via-interface] Default: : a role is not created unless the target arn is specified

Return type:

LifecycleHookTargetConfig

Returns:

the IRole with access to send messages and the ARN of the queue it has access to send messages to.