Class TopicHook
Use an SNS topic as a hook target.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.AutoScaling.HookTargets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class TopicHook : DeputyBase, ILifecycleHookTarget
Syntax (vb)
Public Class TopicHook
Inherits DeputyBase
Implements ILifecycleHookTarget
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScaling.HookTargets;
using Amazon.CDK.AWS.SNS;
Topic topic;
var topicHook = new TopicHook(topic);
Synopsis
Constructors
TopicHook(ITopic) | |
TopicHook(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
TopicHook(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(Construct, IBindHookTargetOptions) | If an |
Constructors
TopicHook(ITopic)
TopicHook(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected TopicHook(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
TopicHook(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected TopicHook(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(Construct, IBindHookTargetOptions)
If an IRole
is found in options
, grant it topic publishing permissions.
public virtual ILifecycleHookTargetConfig Bind(Construct scope, IBindHookTargetOptions options)
Parameters
- scope Constructs.Construct
- options IBindHookTargetOptions
Returns
the IRole
with topic publishing permissions and the ARN of the topic it has publishing permission to.
Remarks
Otherwise, create a new IRole
and grant it topic publishing permissions.