lib/classes/Variables.js/Variables/getValueFromSsm
class Variables:  getValueFromSsm(variableString) {
    const groups = variableString.match(this.ssmRefSyntax);
    const param = groups[1];
    const decrypt = groups[2] === 'true';
    const split = groups[2] === 'split';
    return this.serverless
      .getProvider('aws')
      .request(
        'SSM',
        'getParameter',
        {
          Name: param,
          WithDecryption: decrypt,
        },
        { useCache: true }
      ) // Use request cache
      .then(response => {
        const plainText = response.Parameter.Value;
        const type = response.Parameter.Type;
        // Only if Secrets Manager. Parameter Store does not support JSON.
        // We cannot parse StringList types, so don't try
        if (type !== 'StringList' && param.startsWith('/aws/reference/secretsmanager')) {
          try {
            const json = JSON.parse(plainText);
            return BbPromise.resolve(json);
          } catch (err) {
            // return as plain text if value is not JSON
          }
        }
        if (split) {
          if (type === 'StringList') {
            return BbPromise.resolve(plainText.split(','));
          }
          logWarning(
            `Cannot split SSM parameter '${param}' of type '${type}'. Must be 'StringList'.`
          );
        }
        return BbPromise.resolve(plainText);
      })
      .catch(err => {
        if (err.statusCode !== 400) {
          return BbPromise.reject(new this.serverless.classes.Error(err.message));
        }

        return BbPromise.resolve(undefined);
      });
  }