1
votes

I'm trying to deploy an API Gateway with Lambda integration and I can't get around one particular error. I've checked some posts that took about making sure you've followed the request format, which I believe I have. The error I keep receiving is:

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;

This is what my CloudFormation looks like:

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

Can anyone see what I'm missing?

1

1 Answers

2
votes

There is a small typo in the URI, you have invocation instead of invocations

it should be

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

but you have

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