Serverless-application-model: How to parameterize AWS::Serverless::Function policies?

Created on 8 Aug 2017  路  2Comments  路  Source: aws/serverless-application-model

I have an AWS::Serverless::Function with a policy block like this:

  Policies:
    - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
    - !FindInMap [RoleMap, !Ref Role, LoggingPolicy]

It appears that SAM is silently ignoring the FindInMap rather than transforming the intrinsic function correctly鈥攖he transformed template has only the AWSLambdaBasicExecutionRole in the ManagedPolicyArns list.

For what it's worth, I'm using a similar FindInMap to populate an environment variable, and it works fine.

I assume this is known behavior, but is there a good workaround to allow parameterization of managed policies?

areserverless-function priorit1-critical stagin-progress typbug

Most helpful comment

All 2 comments

This is a bug. Fix is in progress.

Was this page helpful?
0 / 5 - 0 ratings