QueueHook Class
Use an SQS queue as a hook target.
| Source | aws-autoscaling-hooktargets/lib/queue-hook.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling_hooktargets as autoscaling_hooktargets } from 'aws-cdk-lib';
import { aws_sqs as sqs } from 'aws-cdk-lib';
declare const queue: sqs.Queue;
const queueHook = new autoscaling_hooktargets.QueueHook(queue);
python
# 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)
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var queue Queue
queueHook := awscdk.Aws_autoscaling_hooktargets.NewQueueHook(queue)
Initializer
Methods
bind(_scope: Construct, options: BindHookTargetOptions): LifecycleHookTargetConfigdef bind(self, _scope: Construct, options: BindHookTargetOptions) -> LifecycleHookTargetConfigpublic LifecycleHookTargetConfig bind(Construct _scope, BindHookTargetOptions options)public LifecycleHookTargetConfig Bind(Construct _scope, BindHookTargetOptions options)func Bind(_scope Construct, Options BindHookTargetOptions) LifecycleHookTargetConfig #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.
returns
Returns: the IRole with access to send messages and the ARN of the queue it has access to send messages to.