Hello.
I have strange problem with IAM resource: https://serverless.com/framework/docs/providers/aws/guide/iam/
I have a function and for this func I adding the role: ddbElasticsearchBridge
Below in the “resources > Resources” section I’ve added this role.
functions:
DDBtoES:
handler: dynamodb.lambda_handler
role: ddbElasticsearchBridge
...
resources:
Resources:
ddbElasticsearchBridge:
Type: AWS::IAM::Role
Properties:
Path: /
RoleName: ddb-elasticsearch-bridge
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Policies:
- PolicyName: DynamoRead
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- dynamodb:DescribeStream
- dynamodb:GetRecords
- dynamodb:GetShardIterator
Resource: arn:aws:dynamodb:us-east-1:12345678:table/mytablename/stream/2017-04-04T23:34:00.359
But I always getting this error:
Template format error: Unresolved resource dependencies
[IamRoleLambdaExecution] in the Resources block of the template
What I’m doing wrong? The same problem I have if I placing ‘role’ reference to the ‘provider’ section.