Consul-Terraform-Sync Command (CLI)

    Running CTS as a daemon without using a command is deprecated in CTS 0.6.0 and will be removed at a much later date in a major release. For information on the preferred way to run CTS as a daemon review the start command docs

    When CTS runs as a daemon, there is no default configuration to start CTS. You must set a configuration flag -config-file or -config-dir. For example:

      To review a list of available flags, use the -help or -h flag.

      Commands

      In addition to running the daemon, CTS has a set of commands that act as a client to the daemon server. The commands provide a user-friendly experience interacting with the daemon. The commands use the CTS APIs but does not correspond one-to-one with it. Please review the individual commands in the left navigation for more details.

      CTS commands follow the below structure

      1. consul-terraform-sync <command> [options] [args]
      • options: Flags to specify additional settings. There are general options that can be used across all commands and command-specific options.
      • : Required arguments specific to a commands

      Example:

      1. consul-terraform-sync task disable -http-addr=http://localhost:2000 task_a
      1. consul-terraform-sync task disable -http-addr=http://localhost:2000 task_a

      The consul-terraform-sync command features opt-in autocompletion for flags, subcommands, and arguments (where supported).

      To enable autocompletion, run:

      1. $ consul-terraform-sync -autocomplete-install

      When you start typing a CTS command, press the <tab> key to show a list of available completions. To show available flag completes, type -<tab>.

      Autocompletion will query the running CTS server to return helpful argument suggestions. For example, for the task disable command, autocompletion will return the names of all enabled tasks that can be disabled.

      When autocompletion makes the query to the running CTS server, it will also use any CTS_* environment variables (for example CTS_ADDRESS) set on the CTS server.

      Example: Use autocomplete to discover how to disable a task

      Assume a tab is typed at the end of each prompt line:

      1. start task
      2. $ consul-terraform-sync task
      3. create delete disable enable
      4. $ consul task disable