I’m trying to add into an AWS lambda (called UploadTriggerFunction), a policy to invoke another lambda (called EmoryParserFunction) in my template.yaml for AWS SAM.
When I do sam deploy, it’s failing due to an error in the mentioned policy. I’ve searched in the internet and I can’t find a solution.
This is the resource that I have so far (yaml code):
UploadTriggerFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/upload_trigger/
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref DocumentTable
- DynamoDBCrudPolicy:
TableName: !Ref MemoryTable
- S3ReadPolicy:
BucketName: !Sub "${AWS::StackName}-${AWS::Region}-${AWS::AccountId}*"
- SQSSendMessagePolicy:
QueueName: !GetAtt EmbeddingQueue.QueueName
- Statement:
- Sid: "LambdaInvokePermission"
Action: "lambda:*"
FunctionName: !Ref EmoryParserFunction
Principal: "*"
This is the error when I do sam deploy –guided:
UPDATE_FAILED AWS::IAM::Role UploadTriggerFunctionRole Resource handler returned
message: "Syntax errors in
policy. (Service: Iam, Status
Code: 400, Request ID: 67a2b4d
6-4efd-483e-9a20-
290b983f3521)" (RequestToken:
afebd2d9-cc06-70e2-ba50-
5dca6751f288,
HandlerErrorCode:
InvalidRequest)
Question: anybody knows how to add that permission?