Backing up an ephemeral Elasticsearch installation
ElasticSearch can backup itself when told to do so via an API call.
You just need to configure a destination, and optionally credentials, for example you make ElasticSearch create snapshots of its database in AWS S3.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html

You can also automate these calls using a schedule with the Elastic curator tool.

https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/snapshot.html