I am using AWS SAM to deploy my AWS Lambda functions to AWS.
I was able to define the Runtime once in the Globals section and was wondering if I could define a constant for the AWS Role to be assumed by my Lambdas (Role: arn:aws:iam::12345678:role/lambda-role), which is currently repeated in the template file for each function.
Here is my SAM template:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Runtime: python3.7
Resources:
FunctionA:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambdas/
Handler: app.event_handler_a
Role: arn:aws:iam::12345678:role/lambda-role
FunctionB:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambdas/
Handler: app.event_handler_b
Role: arn:aws:iam::12345678:role/lambda-role