End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::S3URISigner#ec2_metadata_credentials_json
ec2_metadata_credentials_json
lib/rubygems/s3_uri_signer.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/s3_uri_signer.rb, line 140
def ec2_metadata_credentials_json
require 'net/http'
require_relative 'request'
require_relative 'request/connection_pools'
require 'json'
iam_info = ec2_metadata_request(EC2_IAM_INFO)
# Expected format: arn:aws:iam::<id>:instance-profile/<role_name>
role_name = iam_info['InstanceProfileArn'].split('/').last
ec2_metadata_request(EC2_IAM_SECURITY_CREDENTIALS + role_name)
end
No documentation available
See also
#create_request_pool
#ec2_metadata_request
#base64_uri_escape
#fetch_s3_config
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1