https://pulumi.com logo
#getting-started
Title
# getting-started
s

silly-morning-20096

09/26/2023, 7:04 AM
Hi, I Need to trigger a lambda using sns topic subscription.
Copy code
var lambdaTopic = new Topic("TranscoderJobCompleteNotifyTopic");

var lambda=new Function(name, new FunctionArgs
        {
            Handler = "app.handler",
            Role = notifierLambdaRole.Arn,
            Runtime = "nodejs18.x",
            Code = new FileArchive(pathToLambda),
            Timeout = 90,
            MemorySize = 384
        });
var subscription=new TopicSubscription(name, new TopicSubscriptionArgs
        {
            Topic = lambdaTopic.Arn,
            Protocol = "lambda",
            Endpoint = notifyFunction.Arn
        }, new CustomResourceOptions
        {
            DependsOn = { lambda, lambdaTopic }
        });
So i deployed the lambda and topic using above code.But after deployed that, i couldn't see subscription arn in lambda trigger console.In addition to that arn also incorrect in this console.Can you please tell me what is the issue in this?
d

dry-keyboard-94795

09/26/2023, 7:52 AM
Needs to be granted permission before it'll show in the console: https://www.pulumi.com/registry/packages/aws/api-docs/lambda/permission/
s

silly-morning-20096

09/26/2023, 7:54 AM
Thanks @dry-keyboard-94795 🙂