lib/plugins/aws/invokeLocal/index.js/AwsInvokeLocal/getLayerPaths
class AwsInvokeLocal:  getLayerPaths() {
    const layers = _.mapKeys(
      this.serverless.service.layers,
      (value, key) => this.provider.naming.getLambdaLayerLogicalId(key)
    );

    return BbPromise.all(
      (this.options.functionObj.layers || this.serverless.service.provider.layers || [])
        .map(layer => {
          if (layer.Ref) {
            return layers[layer.Ref].path;
          }
          const arnParts = layer.split(':');
          const layerArn = arnParts.slice(0, -1).join(':');
          const layerVersion = Number(arnParts.slice(-1)[0]);
          const layerContentsPath = path.join(
            '.serverless', 'layers', arnParts[6], arnParts[7]);
          const layerContentsCachePath = path.join(
            cachePath, 'layers', arnParts[6], arnParts[7]);
          if (fs.existsSync(layerContentsPath)) {
            return layerContentsPath;
          }
          let downloadPromise = BbPromise.resolve();
          if (!fs.existsSync(layerContentsCachePath)) {
            this.serverless.cli.log(`Downloading layer ${layer}...`);
            mkdirp.sync(path.join(layerContentsCachePath));
            downloadPromise = this.provider.request(
              'Lambda', 'getLayerVersion', { LayerName: layerArn, VersionNumber: layerVersion })
              .then(layerInfo => download(
                layerInfo.Content.Location,
                layerContentsCachePath,
                { extract: true }));
          }
          return downloadPromise
            .then(() => fse.copySync(layerContentsCachePath, layerContentsPath))
            .then(() => layerContentsPath);
        }));
  }