Why does AWS keep saying my ARN is invalid?

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 Answer

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"
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like