Run Consul-Terraform-Sync

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.

  1. Move the consul-terraform-sync binary to a location available on your PATH.

    1. $ mv ~/Downloads/consul-terraform-sync /usr/local/bin/consul-terraform-sync
  2. Create the config.hcl file and configure the options for your use case. Refer to the configuration reference for details about all CTS configurations.

  3. Run Consul-Terraform-Sync (CTS).

    1. $ consul-terraform-sync start -config-file <config.hcl>
  4. Check status of tasks. Replace port number if configured in Step 2. Refer to Consul-Terraform-Sync API for additional information.

    1. $ 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.