class Aws::InstanceProfileCredentials

def http_get(connection, path, token = nil)

GET request fetch profile and credentials
def http_get(connection, path, token = nil)
  headers = { 'User-Agent' => "aws-sdk-ruby3/#{CORE_GEM_VERSION}" }
  headers['x-aws-ec2-metadata-token'] = token if token
  response = connection.request(Net::HTTP::Get.new(path, headers))
  raise Non200Response unless response.code.to_i == 200
  response.body
end