1 回答
- 最新
- 投票最多
- 评论最多
0
Use the Role
property instead of Policies
in the AWS::Serverless::Function.
When you use the Policies property, the policies that you've specified will be appended to the default role for this function. Since you didn't specify a role in the template, one is created for you, which has the AWSLambdaBasicExecutionRole.
So, create an IAM role that contains the least privilege polies that you need and then just reference the ARN of that role in the AWS::Serverless::Function. Note that if the Role
property is set, the Policies
property is ignored.
已回答 2 年前
相关内容
- AWS 官方已更新 10 个月前
- AWS 官方已更新 3 年前
Thanks, I understand this much. Can you please point me in the right direction on how I can write a role with my own custom policies for a Lambda function? When I attempt to do so I get a circular dependency error as my policies are referencing my lambda function which has the role attached. Please help.