How to add permissions to an existing Lambda function

0 votes

Hi Guys,

I have created one lambda function from CLI. I want to grant the Amazon SNS service permission to the lambda function. How can I do that?

Nov 5, 2020 in AWS by akhtar
• 38,260 points
2,250 views

1 answer to this question.

0 votes

Hi@akhtar,

You can grant an AWS service or another account permission to use a function. The following add-permission example grants the Amazon SNS service permission to invoke a function named my-function.

$ aws lambda add-permission \
    --function-name my-function \
    --action lambda:InvokeFunction \
    --statement-id sns \
    --principal sns.amazonaws.com
answered Nov 5, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
2 answers

How do I add python libraries to an AWS lambda function for Alexa?

If you get lucky (it depends what ...READ MORE

answered Nov 3, 2020 in AWS by anonymous
15,562 views
0 votes
1 answer

How to add IAM role to an existing instance in aws?

As of AWS CLI v1.11.46,  you can ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
1,649 views
0 votes
1 answer
0 votes
1 answer

How to link AWS Lambda function to Amazon CloudWatch ?

In order to create Log Group and ...READ MORE

answered Jul 20, 2018 in AWS by datageek
• 2,540 points
1,589 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to setup an alarm when Lambda function fails in AWS?

Hi@akhtar, To create an Alarm for Lambda function, ...READ MORE

answered Apr 2, 2020 in AWS by MD
• 95,460 points
4,192 views
0 votes
1 answer

How to add AWS tags to an existing repository in AWS CodeCommit?

Hi@akhtar, You can add or update tags for a resource ...READ MORE

answered Nov 25, 2020 in AWS by MD
• 95,460 points
744 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP