SnsDestination

class aws_cdk.aws_lambda_destinations.SnsDestination(topic)

Bases: object

Use a SNS topic as a Lambda destination.

ExampleMetadata:

infused

Example:

# An sns topic for successful invocations of a lambda function
import aws_cdk.aws_sns as sns


my_topic = sns.Topic(self, "Topic")

my_fn = lambda_.Function(self, "Fn",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler")),
    # sns topic for successful invocations
    on_success=destinations.SnsDestination(my_topic)
)
Parameters:

topic (ITopic) –

Methods

bind(_scope, fn, *, type)

Returns a destination configuration.

Parameters:
Return type:

DestinationConfig