为什么 AWS 一直说我的 ARN 无效?

Why does AWS keep saying my ARN is invalid?

我正在尝试部署一个带有 Lambda 集成的 API 网关,但我无法解决一个特定的错误。我检查了一些关于确保您遵循请求格式的帖子,我相信我已经这样做了。我一直收到的错误是:

Invalid ARN specified in the request: Integrations of type 'AWS_PROXY' currently only supports Lambda function and Firehose stream invocations (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException;

这是我的 CloudFormation 的样子:

Parameters:
EnvType:
    Type: String
    Default: "dev"

Resources:
    routerLambda:
            Type: AWS::Lambda::Function
            Properties:
                 FunctionName: !Sub router-${EnvType}
                 ...

    routerLambdaIntegration:
            Type: AWS::ApiGatewayV2::Integration
            Properties:
                ApiId: !Ref apiGateway
                IntegrationType: AWS_PROXY
                IntegrationUri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:router-dev/invocation"
            DependsOn: routerLambda

谁能看到我遗漏了什么?

URI 中有一个小拼写错误,您使用 invocation 而不是 invocations

应该是

    Target: arn:aws:apigateway:{region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{region}:{account-id}:function:{function-name}/invocations

但你有

  IntegrationUri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:router-dev/invocation"