terraform-provider-ec
terraform-provider-ec copied to clipboard
ec_deployment: Allow users to reset the Elasticsearch password
Overview
To help support cases where the user might have either imported the deployment or changed the password independently, and terraform doesn't have an elasticsearch_password or it's outdated, it would be good to allow users to reset their Elasticsearch password by setting a field boolean field to true.
The endpoint is at /deployments/{deployment_id}/elasticsearch/{ref_id}/_reset-password.
Possible Implementation
Creating a field reset_elasticseach_password of type Bool, where setting the field will reset the Elasticsearch credentials.
This would fix my current situation after I imported an existing deployment.
In my case, after importing deployment, as mentioned in the docs, credentials are empty, but we can workaround this by terraform state pull > state.json, manually add/change credentials, increment serial number and finally terraform state push state.json
In my case, after importing deployment, as mentioned in the docs, credentials are empty, but we can workaround this by
terraform state pull > state.json, manually add/change credentials, increment serial number and finallyterraform state push state.json
Thanks for sharing this workaround, but I think its too "hacky" to be used in general.
IMHO this should be implemented, especially since there is no migration implemented from 0.5.X to 0.6.X