Amazon S3 triggering another a Lambda function in another account

前端 未结 5 1947
梦如初夏
梦如初夏 2020-12-05 20:36

I want to run a lambda in Account B when any object comes into Account A S3 bucket.

But I heard that we can access Lambda from the same account S3 only, for cross-ac

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 20:51

    Both options should be possible. So you can go with the first option, which is minimalistic.

    Use the Cross Account access feature in IAM to grant access to S3(Account A) from Lambda(Account B).

    This is achieved by creating a IAM Role in Account B which is granted to acceses to the bucket in Account A and allowed to assume by the Lambda (In Account B).

    For further details refer the following documentation from AWS.

    • Using Resource-Based Policies for AWS Lambda [Example 2: Bucket
    • Owner Granting Cross-Account Bucket Permissions

提交回复
热议问题