Class SnsDestination
Use a SNS topic as a Lambda destination.
Inheritance
System.Object
SnsDestination
Implements
Namespace: Amazon.CDK.AWS.Lambda.Destinations
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SnsDestination : DeputyBase, IDestination
Syntax (vb)
Public Class SnsDestination
Inherits DeputyBase
Implements IDestination
Remarks
ExampleMetadata: infused
Examples
// An sns topic for successful invocations of a lambda function
using Amazon.CDK.AWS.SNS;
var myTopic = new Topic(this, "Topic");
var myFn = new Function(this, "Fn", new FunctionProps {
Runtime = Runtime.NODEJS_LATEST,
Handler = "index.handler",
Code = Code.FromAsset(Join(__dirname, "lambda-handler")),
// sns topic for successful invocations
OnSuccess = new SnsDestination(myTopic)
});
Synopsis
Constructors
SnsDestination(ITopic) | |
SnsDestination(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
SnsDestination(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(Construct, IFunction, IDestinationOptions) | Returns a destination configuration. |
Constructors
SnsDestination(ITopic)
SnsDestination(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected SnsDestination(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
SnsDestination(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected SnsDestination(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(Construct, IFunction, IDestinationOptions)
Returns a destination configuration.
public virtual IDestinationConfig Bind(Construct scope, IFunction fn, IDestinationOptions options = null)
Parameters
- scope Constructs.Construct
- fn IFunction
- options IDestinationOptions
Returns