AWS Gateway Mock Endpoint not deploying to stage

I 'm deploying a mock endpoint to AWS API Gateway. The MockResource and MockMethod are setup in the API Gateway but it does not deploy to a stage using the command:

sls deploy --stage dev --force --verbose

where dev is the stage I’m deploying to. What am I missing?

Here is the serverless.yml:

service: my-service

 provider:
   name: aws
 
 ...

resources:
  Resources:
    MockResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Fn::GetAtt:
            - ApiGatewayRestApi # our default Rest API logical ID
            - RootResourceId
        PathPart: myendpoint # the endpoint in your API that is set as proxy
        RestApiId:
          Ref: ApiGatewayRestApi
    MockMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        AuthorizationType: None
        HttpMethod: GET
        ResourceId:
          Ref: MockResource
        RestApiId:
          Ref: ApiGatewayRestApi
        MethodResponses:
          - StatusCode: 200
        Integration:
          RequestTemplates:
            application/json: |
              {"statusCode": 200}
          Type: MOCK
          IntegrationResponses:
            - ResponseTemplates:
                application/text: 'OK'
              StatusCode: 200

You need to incorporate the command line options in your variables via “overwriting”, there’s an example in the docs.