lib/plugins/aws/deployFunction/index.js/AwsDeployFunction/deployFunction
class AwsDeployFunction:  deployFunction() {
    const data = fs.readFileSync(this.options.functionObj.artifact);

    const params = {
      FunctionName: this.options.functionObj.name,
      ZipFile: data,
    };

    // Get function stats
    const stats = fs.statSync(this.options.functionObj.artifact);
    const fileSizeInBytes = stats.size;
    const fileSizeInMegabytes = fileSizeInBytes / 1000000.0;
    this.serverless.cli.log(
      [
        `Uploading function: ${this.options.function} `,
        `(${Math.round(fileSizeInMegabytes * 100) / 100}MB)...`,
      ].join(''));

    // Perform upload
    return this.provider.request(
      'Lambda',
      'updateFunctionCode',
      params,
      this.options.stage, this.options.region
    ).then(() => {
      this.serverless.cli.log(`Successfully deployed function: ${this.options.function}`);
    });
  }