I have a lambda function
AuthFunction:
Type: AWS::Serverless::Function
Properties:
PermissionsBoundary: !Sub arn:aws:iam::${AWS::AccountId}:policy/ci
FunctionName: !Sub 'authorizer'
CodeUri: dist/lambdas/authorizer/
Policies:
- !Ref ApiGeneralPolicy
- PolicyName: authFunctionPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- ssm:GetParameter
Resource: !Sub
- arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter${ParameterName}
I want to name the role created by the aws from these policies. Because the PermissionBoundary
allows the createRoles action only on resources arn:aws:iam::{accountId}:role/ci*
. So, how can I name the role?
I don’t want to create a separate role resource because I have more than 20 lambdas, creating the roles resources separately is hard to manage and read. So, I need inline policies.
Is there any way to create inline roles under the function itself ?