gpt4 book ai didi

amazon-web-services - 为什么 AWS 一直说我的 ARN 无效?

转载 作者:行者123 更新时间:2023-12-03 07:14:14 25 4
gpt4 key购买 nike

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

Invalid ARN specified in the request: Integrations of type 'AWS_PROXY'currently only supports Lambda function and Firehose streaminvocations (Service: AmazonApiGatewayV2; Status Code: 400; ErrorCode: 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 中存在一个小拼写错误,您使用了 invoking 而不是 invoices

应该是

    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"

关于amazon-web-services - 为什么 AWS 一直说我的 ARN 无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65841664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com