resources:
  Resources:
    NextStaticAssetsProxyParentResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Fn::GetAtt:
            - ApiGatewayRestApi # serverless default Rest API logical ID
            - RootResourceId
        PathPart: TO_BE_REPLACED
        RestApiId:
          Ref: ApiGatewayRestApi
    NextStaticAssetsProxyResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Ref: NextStaticAssetsProxyParentResource
        PathPart: "{proxy+}" # the endpoint in your API that is set as proxy
        RestApiId:
          Ref: ApiGatewayRestApi
    NextStaticAssetsProxyMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        AuthorizationType: NONE
        ResourceId:
          Ref: NextStaticAssetsProxyResource
        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
