Fetches S3 credentials from a provider at startup, so the first request for a bucket doesn't wait for them.
children = [
{ImagePipe.Source.S3.CredentialWarmup,
provider: ImagePipe.Source.S3.InstanceRole, opts: [], scope: "my-bucket"},
MyAppWeb.Endpoint
]ImagePipe doesn't start it. Add one per bucket. The children need no explicit ids. Each warmup starts the fetch without blocking startup, then stops. The credentials aren't dropped before the first request for the bucket uses them. If the fetch fails, the first request fetches the credentials instead.
Invalid options raise ArgumentError from start_link/1. A :provider
without validate_options/1 raises UndefinedFunctionError.
Options
:provider(atom/0) - Required. The provider module, as in the source's:credentials.:scope(String.t/0) - Required. The bucket whose credentials to fetch.:opts(keyword/0) - The provider's options. They must equal the options in the source's:credentials. Otherwise requests use a different cache entry, and the warmed credentials are refreshed in the background without ever being used. The default value is[].
Summary
Functions
@spec start_link(keyword()) :: GenServer.on_start()