class Aws::ECSCredentials

def get_credentials

def get_credentials
  # Retry loading credentials a configurable number of times if
  # the instance metadata service is not responding.
  retry_errors(NETWORK_ERRORS, max_retries: @retries) do
    open_connection do |conn|
      http_get(conn, @credential_path)
    end
  end
rescue TokenFileReadError, InvalidTokenError
  raise
rescue StandardError => e
  warn("Error retrieving ECS Credentials: #{e.message}")
  '{}'
end