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?
This is a bug. Fix is in progress.
This should be fixed - https://github.com/awslabs/serverless-application-model/releases/tag/1.4.0
Most helpful comment
This should be fixed - https://github.com/awslabs/serverless-application-model/releases/tag/1.4.0