0

我正在尝试通过 AWS Apigateway 解析 ssm 参数,但我找不到任何示例。我定义方法集成的云形成部分如下:

Integration:
   Type: AWS
   Uri: !Sub "arn:aws:apigateway:us-west-2:ssm:action/GetParameter"
   IntegrationHttpMethod: POST
   PassthroughBehavior: NEVER
   RequestTemplates: 
      application/json: ' 
            {
              "Name": "/dev/configs/xoxo"
            }
      '

当我在 AWS 控制台中测试它时,这是日志

Mon Aug 10 18:14:10 UTC 2020 : Method request body before transformations: 
Mon Aug 10 18:14:10 UTC 2020 : Endpoint request URI: https://ssm.us-west-2.amazonaws.com/?Action=GetParameter
Mon Aug 10 18:14:10 UTC 2020 : Endpoint request headers: {Authorization=**********************************************************************************************************************************************************************************************************************************************************************dbf24f, X-Amz-Date=20200810T181410Z, x-amzn-apigateway-api-id=mrvijesndc, Accept=application/json, User-Agent=AmazonAPIGateway_mrvijesndc, X-Amz-Security-Token=...[TRUNCATED]
Mon Aug 10 18:14:10 UTC 2020 : Endpoint request body after transformations: { "Name": "/dev/configs/xoxo"}
Mon Aug 10 18:14:10 UTC 2020 : Sending request to https://ssm.us-west-2.amazonaws.com/?Action=GetParameter
Mon Aug 10 18:14:10 UTC 2020 : Received response. Status: 400, Integration latency: 43 ms
Mon Aug 10 18:14:10 UTC 2020 : Endpoint response headers: {Server=Server, Date=Mon, 10 Aug 2020 18:14:10 GMT, Content-Type=application/json, Content-Length=220, Connection=keep-alive, x-amzn-RequestId=c2e56a30-d846-4cd6-b4af-1df95267a3fd}
Mon Aug 10 18:14:10 UTC 2020 : Endpoint response body before transformations: {"Error":{"Code":"ValidationError","Message":"1 validation error detected: Value null at 'name' failed to satisfy constraint: Member must not be null.","Type":"Sender"},"RequestId":"c2e56a30-d846-4cd6-b4af-1df95267a3fd"}

我想它没有正确拨打电话,有人可以帮助我吗?

4

1 回答 1

0

好吧,经过长时间的研究,谷歌为我隐藏了这篇文章8个小时,终于,我找到了:

https://forums.aws.amazon.com/thread.jspa?threadID=288118

我希望将来对像我这样的人有所帮助

于 2020-08-10T20:30:04.567 回答