Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configure Amazon s3 bucket to run Lambda function created in another account

Is it possible to configure S3 bucket to run a Lambda function created in a different account? Basically what I'm trying to accomplish is that when new items are added to S3 bucket I want to run a lambda function in another account

like image 595
Ram Gopinathan Avatar asked May 12 '16 06:05

Ram Gopinathan


People also ask

Can S3 trigger Lambda in another account?

To have your Amazon S3 bucket invoke a Lambda function in another AWS account, do the following: 1. Update your Lambda function's resource-based permissions policy to grant invoke permission to Amazon S3.

Does Lambda work cross-account?

You can create a Role in account B and permit your User (in account A) to assume it. Create a Role in account A that will be used by your AWS Lambda function. Create a Role in account B with a role type of Role for Cross-Account Access. Assign the desired permissions to use Route 53 in account B.


Video Answer


1 Answers

You can do this by providing the full Lambda Function ARN to your S3 bucket. For example inside your bucket settings in the AWS Console: enter image description here

This article will help you configure the correct IAM for cross account invocation. Also take a look at the AWS Lambda Permissions Model. Note that as far as I know the bucket and the Lambda function have to be in the same region!

like image 169
birnbaum Avatar answered Nov 07 '22 20:11

birnbaum