# Elasticsearch s3 snapshots

**URL:** <https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [May 9, 2024, 12:32am UTC](https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115 "2024-05-09T00:32:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kannan\_raj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kannan_raj/32/63201_2.png) [@kannan\_raj](https://discuss.elastic.co/u/kannan_raj)\
**Post date:** [May 9, 2024, 12:32am UTC](https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115/1 "2024-05-09T00:32:27Z")

</div>

Hello Team,

Is it possible to configure or change the medata service or sts service endpoint when creating s3 snapshot with InstanceProfileCredentialsProvider authentication method.

I have tried with setting the env but by default connecting to some aws ip  
AWS\_WEB\_IDENTITY\_TOKEN\_FILE=[http://localhost//v1/metadata](http://localhost//v1/metadata)

snapshot creation api

```auto
_snapshot/bel -d'{
        "type": "s3",
        "settings": {
            "endpoint": "endpoint",
            "bucket": "elasticsearch-snapshots",
            "region": "us-iad-5",
            "base_path": "elasticsearch/folder",
            "path_style_access": true
        }
}'

```

Error from elasticsearch

```auto
Caused by: com.amazonaws.SdkClientException: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 9, 2024, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115/2 "2024-05-09T07:30:47Z")

</div>

The [AWS SDK docs](https://docs.aws.amazon.com/sdkref/latest/guide/feature-imds-credentials.html) indicate that you can configure a different metadata service endpoint via the `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. I've not tried it, but seems like it's what you are looking for.

(edit: I meant to say "I've not tried it" but missed the vital word "not"!)

---

<div class="post-metadata">

**Author:** ![kannan\_raj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kannan_raj/32/63201_2.png) [@kannan\_raj](https://discuss.elastic.co/u/kannan_raj)\
**Post date:** [May 9, 2024, 3:47pm UTC](https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115/3 "2024-05-09T15:47:59Z")

</div>

@DavidTurner I have tried with `AWS_EC2_METADATA_SERVICE_ENDPOINT` but elasticsearch is not honoring the env.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 9, 2024, 4:00pm UTC](https://discuss.elastic.co/t/elasticsearch-s3-snapshots/359115/4 "2024-05-09T16:00:04Z")

</div>

Not sure then, sorry. It's not really Elasticsearch doing anything here, we're just using the official AWS SDK.
