# `ImagePipe.Source.S3.InstanceRole`
[🔗](https://github.com/hlindset/image_pipe/blob/v0.2.0/image_pipe/lib/image_pipe/source/s3/instance_role.ex#L1)

Credential provider for the IAM role attached to an EC2 instance, including
Elastic Beanstalk, read from the instance metadata service (IMDSv2).

    credentials: {:provider, ImagePipe.Source.S3.InstanceRole, []}

Setting up credentials is covered in
[Serving images from S3](serving-from-s3.md#choose-credentials).

## Options

* `:base_url` (`t:String.t/0`) - Base URL of the instance metadata service. The default value is `"http://169.254.169.254"`.

* `:ttl_seconds` (`t:pos_integer/0`) - Lifetime requested for each metadata session token, in seconds. The default value is `21600`.

* `:receive_timeout` (`t:non_neg_integer/0`) - Milliseconds to wait for each response. The default value is `2000`.

* `:connect_timeout` (`t:non_neg_integer/0`) - Milliseconds to wait for a connection. The default value is `2000`.

---

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