How can I automate version control of Kibana Saved Objects in an AWS environment?
I have an Elasticsearch domain hosted on AWS and I have configured Kibana to visualize the data. Now, I would like to version control the Kibana configuration for several reasons:
- To have a consistent configuration across different environments (dev, stage, prod)
- Disaster recovery in case the Elasticsearch domain is deleted
- To be able to upgrade the Elasticsearch cluster to the latest version (I cannot use the AWS console to upgrade Elasticsearch as suggested in the AWS developer guide, since the Elasticsearch domain is part of a CloudFormation stack. Moreover, according to the CloudFormation user Guide, updating the ElasticsearchVersion requires replacement, hence the need for version control).
The only solution that I have found so far includes several manual steps:
Backup:
- Logon to your first Kibana environment
- Select the
Saved Objects
tab in the Kibana management console - Press the
Export Everything
button - Add the downloaded .json file to version control
Restore:
- Logon to the second Kibana environment
- Select
Index Patterns
tab in the Kibana management console - Re-create the index patterns that are required for the visualizations (see the last warning in the Kibana user guide)
- Select the
Saved Objects
tab in the Kibana management console - Press the
Import
button and upload the .json file that was version controlled - Re-map each index pattern (since the ones stored in the .json file originates from the first Kibana environment does not exist in the second environment)
- Done(?)
How can this be automated?
Current environment:
- Elasticsearch version 6.2.3
- Kibana version 6.2.3