So I have created a terraform script that does the following:
Now I need to configure the ec2 instance with the endpoint I get back from elasticsearch domain, so the application are using the right endpoint (currently it has some default value).
How can I pass the endpoint value into the file and then copy it over to the ec2 instance. What would be the recommended approach?
Thanks in advance.
Terraform will derive the order automatically, when you refer to the output of a certain resource. You can use the file
provisioner to create files on the EC2 instance.