code: static Map<String, String> parseJson(String in) {
      if (in == null) {
        return Collections.emptyMap();
      }
      String noBraces = in.replace('{', ' ').replace('}', ' ').trim();
      Map<String, String> builder = new LinkedHashMap<String, String>();
      Matcher matcher = JSON_FIELDS.matcher(noBraces);
      while (matcher.find()) {
        String key = keyMap.get(matcher.group(1));
        if (key != null) {
          builder.put(key, matcher.group(2));
        }
      }
      return builder;
    }
docs: IAM Instance Profile format is simple, non-nested json.
  
  ex.
  
  <pre>
  {
  "Code" : "Success",
  "LastUpdated" : "2013-02-26T02:03:57Z",
  "Type" : "AWS-HMAC",
  "AccessKeyId" : "AAAAA",
  "SecretAccessKey" : "SSSSSSS",
  "Token" : "TTTTTTT",
  "Expiration" : "2013-02-26T08:12:23Z"
  }
  
  </pre>
  
  This impl avoids choosing a json library by parsing the simple structure above directly.