class Aws::Plugins::RegionalEndpoint

def shared_config_endpoint(cfg)

def shared_config_endpoint(cfg)
  service_id = cfg.api.metadata['serviceId'] || cfg.api.metadata['endpointPrefix']
  return unless endpoint = Aws.shared_config.configured_endpoint(profile: cfg.profile, service_id: service_id)
  cfg.logger&.debug(
    "Endpoint configured from shared config(profile: #{cfg.profile}): #{endpoint}\n")
  endpoint
end