Jer*_*ong 9 amazon-web-services amazon-ecs amazon-elb aws-api-gateway aws-fargate
无法让 API Gateway 与私有 VPC 链接(在网络负载均衡器后面到 Fargate 容器)容器一起使用
大家好,过去三天我一直在努力让它发挥作用。我的目标是设置一个 POST 方法,该方法重定向到运行 Go 容器的私有 VPC。我在线查看了一些指南并尝试了其中的大部分。为了这个实验,我复制了我们的容器在单个网络负载均衡器后面运行,创建了一个 VPC 链接并设置了 API 方法来使用它,但是当我测试它时,我得到的只是一个非常无用的 500内部服务器错误。我查看了我的 CloudWatch 日志,我很确定容器没有被击中。任何帮助都会很棒,让我知道我需要提供什么,以便我可以提供帮助。
谢谢!
这是我在测试方法时从 API Gateway 得到的:
Thu Aug 22 23:27:10 UTC 2019 : Endpoint request body after transformations: { "userId": <omitted>, ... }
Thu Aug 22 23:27:10 UTC 2019 : Sending request to http://<network load balancer DNS>:<port my code listens to>/api/someApi
Thu Aug 22 23:27:20 UTC 2019 : Execution failed due to configuration error: There was an internal error while executing your request
Thu Aug 22 23:27:20 UTC 2019 : Method completed with status: 500
Run Code Online (Sandbox Code Playgroud)
我们最终能够让它发挥作用。此 API 网关中公开的每个方法都填充了如下属性:
AuthorizationType
HttpMethod
RequestParameters:
method.request.path.bla
Integration:
ConnectionType: VPC_LINK
ConnectionId: !ImportValue bla
RequestParameters:
integration.request.path.bla: method.request.path.bla
IntegrationHttpMethod: POST
Type: HTTP_PROXY
Uri:
Fn::Sub:
- http://${dnsName}/api/bla
- dnsName:
Run Code Online (Sandbox Code Playgroud)
IIRC 让它发挥作用的主要是将连接类型指定为 VPC 链接
归档时间: |
|
查看次数: |
868 次 |
最近记录: |