Retrieve serverless.yml output value in aws codebuild

What is the best way to retrieve the value of an output defined in serverless.yaml in my aws codebuild?

In this scenario, I want to retrieve ApiUrl in my codebuild buildspec file.

  Outputs:
    ApiUrl:
      Description: "The API Gateway URL"
      Value:
        Fn::Join:
          - ""
          - - "https://"
            - Ref: ApiGatewayRestApi
            - ".execute-api.${self:provider.region}.amazonaws.com/${self:custom.stage}"