# Creating a template with an alias that does not yet exist

**URL:** <https://discuss.elastic.co/t/creating-a-template-with-an-alias-that-does-not-yet-exist/60325>\
**Category:** Elasticsearch\
**Created:** [September 12, 2016, 6:11pm UTC](https://discuss.elastic.co/t/creating-a-template-with-an-alias-that-does-not-yet-exist/60325 "2016-09-12T18:11:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neoform](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neoform/32/680_2.png) [@neoform](https://discuss.elastic.co/u/neoform)\
**Post date:** [September 12, 2016, 6:11pm UTC](https://discuss.elastic.co/t/creating-a-template-with-an-alias-that-does-not-yet-exist/60325/1 "2016-09-12T18:11:36Z")

</div>

Is there a way to create a template that adds the newly created into a non-existent alias?

I'm creating a template that will be used in the creation of new indexes (none of which exist yet). I want to specify an alias to be automatically added to all the new indexes that get created, however I can't, since I can't seem to create an alias without already having an index.

This seems like a chicken/egg situation, since I can't create a template that makes use an alias, and I can't create an alias until I have the index that gets created by the template...

---

<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 5, 2017, 10:20pm UTC](https://discuss.elastic.co/t/creating-a-template-with-an-alias-that-does-not-yet-exist/60325/2 "2017-07-05T22:20:59Z")

</div>


