class Google::Auth::ExternalAccount::AwsCredentials

def fetch_metadata_role_name

Raises:
  • (Google::Auth::CredentialsError) - If the credential verification URL is not set or if the request fails

Returns:
  • (String) - The AWS role name
def fetch_metadata_role_name
  unless @credential_verification_url
    raise CredentialsError.with_details(
      "Unable to determine the AWS metadata server security credentials endpoint",
      credential_type_name: self.class.name,
      principal: principal
    )
  end
  get_aws_resource(@credential_verification_url, "IAM Role").body
end