# `IMDS.Discovery`

The provider detection of `IMDS.detect/1`.

The module probes the providers of `IMDS.Providers.all/0` in order. The first
`:ok` answer wins. The failed probes of the other providers are not errors:
they only mean that the instance is not of that provider.

The environment variable `INSTANCE_METADATA_PROVIDER` and the `:provider`
option skip the probe. A value that names no provider is an error.

# `detect`

```elixir
@spec detect(keyword()) ::
  {:ok, IMDS.Provider.provider()} | {:error, IMDS.Provider.reason()}
```

Return the identifier of the provider of the current instance.

# `provider`

```elixir
@spec provider(keyword()) :: {:ok, module()} | {:error, IMDS.Provider.reason()}
```

Return the module of the provider of the current instance.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
