aws-cdk-lib.aws_autoscaling_hooktargets.TopicHook

class TopicHook

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.HookTargets.TopicHook
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscalinghooktargets#TopicHook
Javasoftware.amazon.awscdk.services.autoscaling.hooktargets.TopicHook
Pythonaws_cdk.aws_autoscaling_hooktargets.TopicHook
TypeScript (source)aws-cdk-lib » aws_autoscaling_hooktargets » TopicHook

Implements ILifecycleHookTarget

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

NameDescription
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 BindHookTargetOptions

Returns

  • LifecycleHookTargetConfig

If an IRole is found in options, grant it topic publishing permissions.

Otherwise, create a new IRole and grant it topic publishing permissions.