lib/plugins/aws/deployFunction/index.js/AwsDeployFunction/checkIfFunctionExists
class AwsDeployFunction:  checkIfFunctionExists() {
    // check if the function exists in the service
    this.options.functionObj = this.serverless.service.getFunction(this.options.function);

    // check if function exists on AWS
    const params = {
      FunctionName: this.options.functionObj.name,
    };

    return this.provider.request(
      'Lambda',
      'getFunction',
      params
    )
      .then((result) => {
        this.serverless.service.provider.remoteFunctionData = result;
        return result;
      })
      .catch(() => {
        const errorMessage = [
          `The function "${this.options.function}" you want to update is not yet deployed.`,
          ' Please run "serverless deploy" to deploy your service.',
          ' After that you can redeploy your services functions with the',
          ' "serverless deploy function" command.',
        ].join('');
        throw new this.serverless.classes.Error(errorMessage);
      });
  }