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公式更新しました 3年前
- AWS公式更新しました 10ヶ月前
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.