flux627 / serverless-plugin-lambda-account-access

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serverless-plugin-lambda-account-access

Add policies to allow cross-account access to your functions.

Usage Example

serverless.yml

service: sample

plugins:
  - serverless-plugin-lambda-account-access

provider:
  permitAccounts: 000001,000002 # CSV list of AWS account numbers

functions:
  function1:
  function2:

The above allows all functions to be invoked from the listed accounts.

Permissions are granted by adding resources of the form:

resources:
  Resources:
    Function1LambdaFunctionPermitInvokeFromAccount000001:
	  Type: AWS::Lambda::Permission
      Properties:
        Action: lambda:InvokeFunction
        FunctionName:
          Fn::GetAtt:
            - Function1LambdaFunction
            - Arn
	    Principal: 000001

About


Languages

Language:JavaScript 100.0%