首页 > 解决方案 > 取消选中“使用 lambda 代理集成”cloudformation

问题描述

我有一个云形成模板来创建 API Gateway 资源。

APIGateWayEQFAPIRequestGET:
    DependsOn: LambdaEQFAPIPermission
    Type: 'AWS::ApiGateway::Method'
    Properties:
      AuthorizationType: NONE
      HttpMethod: GET
      Integration:
        Type: AWS
        IntegrationHttpMethod: POST
        Uri: !Join 
          - ''
          - - 'arn:aws:apigateway:'
            - !Ref 'AWS::Region'
            - ':lambda:path/2015-03-31/functions/'
            - !GetAtt 
              - LambdaEQFReportsAPIFunction
              - Arn
            - /invocations
        IntegrationResponses:
          - StatusCode: 200
            ResponseTemplates:
              application/json: $input.json('$.body')
        RequestTemplates:
          application/json: '{}'

      ResourceId: !GetAtt 
        - APIGateWayEQFAPI
        - RootResourceId
      RestApiId: !Ref APIGateWayEQFAPI
      MethodResponses:
        - StatusCode: 200

一切都按预期工作,但选中了“使用 Lambda 代理集成”。我可以手动取消选中它,但是如何使用 cloudformation 取消选中。

我尝试了不同的 Integration.Type: AWS/AWS_PROXY 都对它没有任何影响。

标签: amazon-web-servicesaws-lambdaamazon-cloudformationaws-api-gatewayapi-gateway

解决方案


我弄清楚为什么会这样。
当我运行堆栈时,我使用了 AWS_PROXY。然后将 AWS_PROXY 更改为 AWS 并没有部署该方法。我不得不重命名该方法,一切看起来都符合预期。


推荐阅读