# How to use more than one S3 config?

**URL:** <https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872>\
**Category:** Elasticsearch\
**Created:** [February 18, 2020, 10:21pm UTC](https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872 "2020-02-18T22:21:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [February 18, 2020, 10:21pm UTC](https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872/1 "2020-02-18T22:21:36Z")

</div>

We are currently using Amazon S3 for snapshots, but am investigating the possibility of using a S3-compatible solution instead. When looking at the docs here: [https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html#repository-s3-compatible-services](https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html#repository-s3-compatible-services) we are wondering if there is a way to setup multiple S3 stores and thus multiple credentials?

In the docs, specifically for

```auto
bin/elasticsearch-keystore add s3.client.default.access_key
bin/elasticsearch-keystore add s3.client.default.secret_key

```

It doesn’t appear that these keys are tied to the repository and rather they appear to be tied to S3 directly.

1. Is it possible to have multiple S3 config?
2. If so, how do I do it?

Thanks!

---

<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:** [February 18, 2020, 11:05pm UTC](https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872/2 "2020-02-18T23:05:39Z")

</div>

Yes. Quoting [these docs](https://www.elastic.co/guide/en/elasticsearch/plugins/7.6/repository-s3-client.html#repository-s3-client):

> The client that you use to connect to S3 has a number of settings available. The settings have the form `s3.client.CLIENT_NAME.SETTING_NAME` . By default, `s3` repositories use a client named `default` , but this can be modified using the [repository setting](https://www.elastic.co/guide/en/elasticsearch/plugins/7.6/repository-s3-repository.html)`client`.

So replace the `default` in your settings with some other name (e.g. `s3.client.special.access_key`) and include `"client": "special"` in your repository definition.

---

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [February 19, 2020, 1:52am UTC](https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872/3 "2020-02-19T01:52:51Z")

</div>

Thank you — this works!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 18, 2020, 1:59am UTC](https://discuss.elastic.co/t/how-to-use-more-than-one-s3-config/219872/4 "2020-03-18T01:59:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
