class TopicHook
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AutoScaling.HookTargets.TopicHook |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsautoscalinghooktargets#TopicHook |
Java | software.amazon.awscdk.services.autoscaling.hooktargets.TopicHook |
Python | aws_cdk.aws_autoscaling_hooktargets.TopicHook |
TypeScript (source) | aws-cdk-lib » aws_autoscaling_hooktargets » TopicHook |
Implements
ILifecycle
Use an SNS topic as a hook target.
Example
// 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_sns as sns } from 'aws-cdk-lib';
declare const topic: sns.Topic;
const topicHook = new autoscaling_hooktargets.TopicHook(topic);
Initializer
new TopicHook(topic: ITopic)
Parameters
- topic
ITopic
Methods
Name | Description |
---|---|
bind(_scope, options) | If an IRole is found in options , grant it topic publishing permissions. |
bind(_scope, options)
public bind(_scope: Construct, options: BindHookTargetOptions): LifecycleHookTargetConfig
Parameters
- _scope
Construct
- options
Bind
Hook Target Options
Returns
If an IRole
is found in options
, grant it topic publishing permissions.
Otherwise, create a new IRole
and grant it topic publishing permissions.