class SnsDestination
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.Destinations.SnsDestination |
Java | software.amazon.awscdk.services.lambda.destinations.SnsDestination |
Python | aws_cdk.aws_lambda_destinations.SnsDestination |
TypeScript (source) | @aws-cdk/aws-lambda-destinations » SnsDestination |
Implements
IDestination
Use a SNS topic as a Lambda destination.
Example
// An sns topic for successful invocations of a lambda function
import * as sns from '@aws-cdk/aws-sns';
const myTopic = new sns.Topic(this, 'Topic');
const myFn = new lambda.Function(this, 'Fn', {
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
// sns topic for successful invocations
onSuccess: new destinations.SnsDestination(myTopic),
})
Initializer
new SnsDestination(topic: ITopic)
Parameters
- topic
ITopic
Methods
Name | Description |
---|---|
bind(_scope, fn, _options?) | Returns a destination configuration. |
bind(_scope, fn, _options?)
public bind(_scope: Construct, fn: IFunction, _options?: DestinationOptions): DestinationConfig
Parameters
- _scope
Construct
- fn
IFunction
- _options
Destination
Options
Returns
Returns a destination configuration.