Serverlesserror-CloudFormation 模板无效 [*SourceArn/Fn::Join/1/1] 模板中不允许使用“空”值

问题描述 投票:0回答:0

我正在尝试使用 cloudformation 部署函数和 aws api 网关。在 /Resources/LambdaPermission/Type/SourceArn/Fn::Join/ 中验证我的 cloudformation 模板时,出现以下错误 CloudFormation 模板无效:[/Resources/LambdaPermission/Type/SourceArn/Fn::Join/1/1] 模板中不允许使用“空”值

我的代码:

    LambdaPermission:
      Type: AWS::Lambda::Permission
      DependsOn: MessageLambdaFunction
      Properties:
        Action: lambda:InvokeFunction
        FunctionName: !Ref MessageLambdaFunction
        Principal: apigateway.amazonaws.com
        SourceArn: 
          Fn::Join:
            - ''
            - - 'arn:aws:execute-api:'
              - ${self:custom.${opt:stage}.region}
              - ':'
              - ${self:custom.${opt:stage}.accountId}
              - ':'
              - !Ref RestAPI
              - '/*/POST/exit'
amazon-web-services aws-cloudformation aws-api-gateway serverless aws-serverless
© www.soinside.com 2019 - 2024. All rights reserved.