微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AWS :: ApiGateway ::方法在每个部署中均被删除

如何解决AWS :: ApiGateway ::方法在每个部署中均被删除

我有一个带有cloudformation模板的代码管道。 我正在创建一个AWS :: ApiGateway :: Resource和AWS :: ApiGateway ::方法来访问S3存储桶。 第一次使用API​​创建方法。但是当我将更改推送到仓库时 并重新部署删除方法

我不能,这就是原因。有人有任何线索!谢谢!

QrResource:
    Type: "AWS::ApiGateway::Resource"
    Properties:
      ParentId:
        Fn::GetAtt:
          - "myApi"
          - "RootResourceId"
      RestApiId: !Ref myApi
      PathPart: "qr"
  QrItemResource:
    Type: "AWS::ApiGateway::Resource"
    Properties:
      ParentId: !Ref QrResource
      RestApiId: !Ref myApi
      PathPart: "{item}"
  Qr:
    Type: "AWS::ApiGateway::Method"
    Properties:
      HttpMethod: GET
      ApiKeyrequired: false
      AuthorizationType: NONE
      RequestParameters:
        method.request.header.Content-disposition: false
        method.request.header.Content-Type: false
        method.request.header.Accept: false
        method.request.path.item: true
      MethodResponses:
        - StatusCode: 200
          ResponseParameters:
            method.response.header.Content-Type: integration.response.header.Content-Type
            method.response.header.Content-disposition: integration.response.header.Content-disposition
            method.response.header.Accept-Ranges: integration.response.header.Accept-Ranges
          ResponseModels:
            "application/json": EmptyModel
        - StatusCode: 403
          ResponseModels:
            "application/json": ErrorModel
      RestApiId: !Ref myApi
      ResourceId: !Ref QrItemResource
      Integration:
        Type: AWS
        Credentials: !Ref RoleApi
        IntegrationHttpMethod: GET
        PassthroughBehavior: WHEN_NO_MATCH
        IntegrationResponses:
          - StatusCode: 200
            SelectionPattern: 200
            ContentHandling: CONVERT_TO_BINARY
            ResponseParameters:
              method.response.header.Content-Type: integration.response.header.Content-Type
              method.response.header.Accept-Ranges: "'bytes'"
              method.response.header.Content-disposition: "'inline'"
            ResponseTemplates:
              "application/json": ""
        RequestParameters:
          integration.request.header.Content-disposition: method.request.header.Content-disposition
          integration.request.header.Content-Type: method.request.header.Content-Type
          integration.request.header.Accept: method.request.header.Accept
          integration.request.path.item: method.request.path.item
        Uri: arn:aws:apigateway:us-east-1:s3:path/s3-bucket/{item}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。