# PUT index working despite action.auto\_create\_index=false?

**URL:** <https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086>\
**Category:** Elasticsearch\
**Created:** [June 17, 2019, 2:23pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086 "2019-06-17T14:23:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![heiko.dietze](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@heiko.dietze](https://discuss.elastic.co/u/heiko.dietze)\
**Post date:** [June 17, 2019, 2:23pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086/1 "2019-06-17T14:23:15Z")

</div>

Hello all,

I got a question regarding the "action.auto\_create\_index" setting.  
I have started with documentation in the reference [https://www.elastic.co/guide/en/elasticsearch/reference/7.1/docs-index\_.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.1/docs-index_.html)  
Reading this, I would expect to be able to disable all index creation.

But after setting an exclusion pattern (whitelist or blacklist) or even completely forbid the creation, I'm still able to create an empty index with a simple PUT to the REST API.

Is that intended behavior or did I read the documentation wrong?

How to reproduce:

```
PUT _cluster/settings
{
    "persistent": {
        "action.auto_create_index": "false" 
    }
}

```

`PUT new_index_name`

This was tested on the latest elasticsearch download: stable 7.1.1 windows  
But we have seen this also in earlier versions and also when setting the value via yaml config.

P.S. The good news, when I try to do a PUT with a document, that seems to be properly forbidden.

---

<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:** [June 17, 2019, 3:41pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086/2 "2019-06-17T15:41:21Z")

</div>

This is the expected behaviour. `action.auto_create_index` is there to prevent Elasticsearch from _automatically_ creating indices when asked to index documents into an index that doesn't currently exist. However `PUT new_index_name` is an _explicit_ index creation, not an _automatic_ one, so `action.auto_create_index` has no effect.

---

<div class="post-metadata">

**Author:** ![heiko.dietze](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@heiko.dietze](https://discuss.elastic.co/u/heiko.dietze)\
**Post date:** [June 17, 2019, 7:41pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086/3 "2019-06-17T19:41:53Z")

</div>

Hello David,

thank you for the super fast response and clarification.  
So I did misunderstand the documentation.  
(May be this can be added to the documentation?)

Is there a way to achieve this (white-list/black-list of allowed indices) even for explicit PUT commands? We are looking into this due to accidental PUTs of buggy scripts.

best regards,  
Heiko

---

<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:** [June 17, 2019, 9:18pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086/4 "2019-06-17T21:18:41Z")

</div>

The docs you linked are specifically about indexing operations, i.e. operations on documents, and not about explicit index creation operations, so I think they make sense. But of course I'm used to them. If there's something you can think of that would have helped then please open a PR.

I think the best bet for preventing certain actions is to use Security, although I'm not the best person to ask about the details.

---

<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:** [July 15, 2019, 9:18pm UTC](https://discuss.elastic.co/t/put-index-working-despite-action-auto-create-index-false/186086/5 "2019-07-15T21:18:43Z")

</div>

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