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



我试图部署一个API网关与Lambda集成,我不能得到一个特定的错误。我查看了一些关于确保你遵循请求格式的帖子,我相信我做到了。我一直收到的错误是:

请求中指定的无效ARN:类型'AWS_PROXY'的集成目前只支持Lambda函数和Firehose流调用服务:AmazonApiGatewayV2;状态码:400;错误代码: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中有一个小错字,您将invocations改为invocation

应该是

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"

相关内容

  • 没有找到相关文章

最新更新