I have a simple AWS::IAM::Role
defined in my CloudFormation template. Its role is to allow APIGateway to call my lambda functions.
However, during my sam deploy
I get the following:
CREATE_FAILED AWS::IAM::Role InvokeHelloWorldFunctionRole Invalid service prefix for action
'sts.AssumeRole' (Service:
AmazonIdentityManagement; Status Code: 400;
Error Code: MalformedPolicyDocument; Request
ID: 710ffdba-254f-4330-a19e-4b0d14c9a3cf;
Proxy: null)
The resource definition in the template is as follows:
InvokeHelloWorldFunctionRole:
Type: AWS::IAM::Role
Properties:
RoleName: varun-helloWorldLambdaRole
Tags:
- Key: created-by
Value: VarunGawande
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- apigateway.amazonaws.com
Action:
- sts.AssumeRole
Path: /
Policies:
- PolicyName: InvokeHelloWorldLambda
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: !GetAtt HelloWorldFunction.Arn
Hope someone can point me in the right direction.