End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::S3URISigner#ec2_metadata_request
ec2_metadata_request(url)
lib/rubygems/s3_uri_signer.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/s3_uri_signer.rb, line 152
def ec2_metadata_request(url)
uri = URI(url)
@request_pool ||= create_request_pool(uri)
request = Gem::Request.new(uri, Net::HTTP::Get, nil, @request_pool)
response = request.fetch
case response
when Net::HTTPOK then
JSON.parse(response.body)
else
raise InstanceProfileError.new("Unable to fetch AWS metadata from #{uri}: #{response.message} #{response.code}")
end
end
No documentation available
See also
#ec2_metadata_credentials_json
#fetch_s3_config
#create_request_pool
#generate_canonical_query_params
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0