A new platform for documentation and tutorials is launching soon.
We are migrating Consul documentation into HashiCorp Developer, our new developer experience.
This topic describes the basic procedure for running Consul-Terraform-Sync (CTS). Verify that you have met the basic requirements before attempting to run CTS.
consul-terraform-syncbinary to a location available on your
$ mv ~/Downloads/consul-terraform-sync /usr/local/bin/consul-terraform-sync
Create the config.hcl file and configure the options for your use case. Refer to the configuration reference for details about all CTS configurations.
Run Consul-Terraform-Sync (CTS).
$ consul-terraform-sync start -config-file <config.hcl>
Check status of tasks. Replace port number if configured in Step 2. Refer to Consul-Terraform-Sync API for additional information.
$ curl localhost:8558/status/tasks
»Other Run modes
You can configure CTS for high availability, which is an enterprise capability that ensures that all changes to Consul that occur during a failover transition are processed and that CTS continues to operate as expected.
You can start CTS in inspect mode to review and test your configuration before applying any changes. Inspect mode allows you to verify that the changes work as expected before running them in an unsupervised daemon mode.
For hands-on instructions on using inspect mode, refer to the Consul-Terraform-Sync Run Modes and Status Inspection tutorial.