Intra service communication

If I got a bunch of api gateway + Lambda microservices and one of them needs to call the other, then should I call it via the api gateway or via the lambda directly ?

If you can do direct lambda calls that will be cheaper and faster.

You will need to add IAM permissions for services to invoke each others functions.

provider:
  name: aws
  runtime: nodejs6.10
  iamRoleStatements:
    - Effect: Allow
      Action: [ lambda:InvokeFunction ]
      Resource: 'arn of other services function I want to invoke'
1 Like