Reputation: 163
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.
Upvotes: 0
Views: 642
Reputation: 8347
If the EC2 instances don't need to be created prior to the Elasticsearch domain, you can use the template provider and render the file based on the values of the Elasticsearch resource, render and copy up to the EC2 instances.
Upvotes: 0
Reputation: 37630
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.
Upvotes: 1