resources:
  Resources:
    StaticAssetsProxyParentResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Fn::GetAtt:
            - ApiGatewayRestApi # serverless default Rest API logical ID
            - RootResourceId
        PathPart: TO_BE_REPLACED
        RestApiId:
          Ref: ApiGatewayRestApi
    StaticAssetsProxyResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Ref: StaticAssetsProxyParentResource
        PathPart: "{proxy+}" # the endpoint in your API that is set as proxy
        RestApiId:
          Ref: ApiGatewayRestApi
    StaticAssetsProxyMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        AuthorizationType: NONE
        ResourceId:
          Ref: StaticAssetsProxyResource
        RestApiId:
          Ref: ApiGatewayRestApi
        HttpMethod: GET
        MethodResponses:
          - StatusCode: 200
        RequestParameters:
          method.request.path.proxy: true
        Integration:
          IntegrationHttpMethod: GET
          Type: HTTP_PROXY
          Uri: TO_BE_REPLACED
          RequestParameters:
            integration.request.path.proxy: method.request.path.proxy
          IntegrationResponses:
            - StatusCode: 200
