selvakumar
selvakumar

Reputation: 73

Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [**] is invalid. Type of property 'Role' is invalid

I am facing the following error in aws cloudformation

Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [AbortMultipartUpload] is invalid. Type of property 'Role' is invalid. Resource with id [CompleteMultipartUpload] is invalid. Type of property 'Role' is invalid.. Rollback requested by user.

Documents.yaml

  CompleteMultipartUpload:
    Type: AWS::Serverless::Function
    DependsOn: RolesStack
    Properties:
      FunctionName: !Sub ${Prefix}-doc-CompleteMultipartUpload-lmd
      Handler: main
      Runtime: go1.x
      CodeUri: ../../Lambdas/Go/CompleteMultipartUpload
      AutoPublishAlias: !Ref Prefix
      DeploymentPreference:
        Type: AllAtOnce
      Description: 'Function to complete the multipart upload in document bucket'
      MemorySize: 128
      Role:
        - Fn::ImportValue:
            !Sub ${Prefix}-doc-CompleteMultipartUploadRoleArn```

Role ${Prefix}-doc-CompleteMultipartUploadRoleArn i was exported from RolesStack.yaml

Upvotes: 2

Views: 5896

Answers (1)

Marcin
Marcin

Reputation: 238209

Role should be just String, not an Array. So you should have:

      Role: 
        Fn::ImportValue:
            !Sub ${Prefix}-doc-CompleteMultipartUploadRoleArn

Upvotes: 2

Related Questions