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년 전
- 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.