lib/classes/Variables.js/Variables/getValueFromFile
class Variables:  getValueFromFile(variableString) {
    const matchedFileRefString = variableString.match(this.fileRefSyntax)[0];
    const referencedFileRelativePath = matchedFileRefString
      .replace(this.fileRefSyntax, (match, varName) => varName.trim());
    const referencedFileFullPath = path.join(this.serverless.config.servicePath,
      referencedFileRelativePath);

    let valueToPopulate = this.serverless.utils.readFileSync(referencedFileFullPath);
    if (matchedFileRefString !== variableString) {
      let deepProperties = variableString
        .replace(matchedFileRefString, '');
      if (deepProperties.substring(0, 1) !== ':') {
        const errorMessage = [
          'Invalid variable syntax when referencing',
          ` file "${referencedFileRelativePath}" sub properties`,
          ' Please use ":" or "." to reference sub properties.',
        ].join('');
        throw new this.serverless.classes
          .Error(errorMessage);
      }
      deepProperties = deepProperties.slice(1).split('.');
      valueToPopulate = this.getDeepValue(deepProperties, valueToPopulate);
    }

    return valueToPopulate;
  }