lib/plugins/aws/deployFunction/index.js/AwsDeployFunction/constructor
class AwsDeployFunction:  constructor(serverless, options) {
    this.serverless = serverless;
    this.options = options || {};
    this.packagePath = this.options.package ||
      this.serverless.service.package.path ||
      path.join(this.serverless.config.servicePath || '.', '.serverless');
    this.provider = this.serverless.getProvider('aws');

    // used to store data received via AWS SDK
    this.serverless.service.provider.remoteFunctionData = null;

    Object.assign(this, validate);

    this.hooks = {
      'deploy:function:initialize': () => BbPromise.bind(this)
        .then(this.validate)
        .then(this.checkIfFunctionExists),

      'deploy:function:packageFunction': () => this.serverless.pluginManager
        .spawn('package:function'),

      'deploy:function:deploy': () => BbPromise.bind(this)
        .then(() => {
          if (!this.options['update-config']) {
            return this.deployFunction();
          }

          return BbPromise.resolve();
        })
        .then(this.updateFunctionConfiguration)
        .then(() => this.serverless.pluginManager.spawn('aws:common:cleanupTempDir')),
    };
  }