start

The start command starts the Consul-Terraform-Sync (CTS) daemon.

Usage

  1. $ consul-terraform-sync start -config-file <instance-configuration-file> [OPTIONS]

The -config-file or -config-dir flag is required. Use the flag to specify the CTS instance configuration file or directory containing several configuration files to start a CTS cluster.

Options

The following table describes all of the available flags.

NameRequiredTypeDescriptionDefault
-config-dirRequired when -config-file is not setstringSpecifies a directory containing CTS instance configuration files to load on startup. Files must be in HCL or JSON format. You can specify the flag multiple times to load more than one directory of files.none
-config-fileRequired when -config-dir is not setstringSpecifies the CTS instance configuration file to load on startup. Files must be in HCL or JSON format. You can specify the flag multiple times to load more than one file.none
-inspectOptionalbooleanStarts CTS in inspect mode . In inspect mode, CTS displays the proposed state changes for all tasks once and exits. No changes are applied. Refer to Modes for additional information. If an error occurs before displaying all changes, CTS exits with a non-zero status.false
-inspect-taskOptionalstringStarts CTS in inspect mode for the specified task. CTS displays the proposed state changes for the specified task and exits. No changes are applied.
You can specify the flag multiple times to display more than one task.
If an error occurs before displaying all changes, CTS exits with a non-zero status.
none
-onceOptionalbooleanStarts CTS in once-mode. In once-mode, CTS renders templates, runs tasks once, and disables buffer periods. Refer to Modes for additional information.false
-reset-storageOptionalbooleanEnterprise Directs CTS to overwrite the state storage with new state information when the instance you are starting is elected the cluster leader.
Only use this flag when running CTS in high availability mode.
false
-h, -helpOptionalbooleanPrints the CTS command line help.false

Modes

By default, CTS starts in long-running mode. The following table describes all available CTS modes.

NameDescriptionHow to start
Long-running modeCTS starts in once-mode and switches to a long-running process.

During the once-mode phase, the daemon exits with a non-zero status if it encounters an error.

After successfully operating in once-mode, CTS begins a long-running process.

When the long-running process begins, the CTS daemon serves API and command requests.

If an error occurs, CTS logs it and continues running.

No additional flags.
This is the default mode.
Once-modeIn once-mode, CTS renders templates and runs tasks once. CTS does not start the process in long-running mode and disables buffer periods.

Use once-mode before starting CTS in long-running mode to verify that your configuration is accurate and tasks update network infrastructure as expected.

Add the -once flag when starting CTS.
Inspect modeCTS displays the proposed state changes for all tasks once and exits. No changes are applied. If an error occurs before displaying all changes, CTS exits with a non-zero status.

Use inspect mode before starting CTS in long-running mode to debug one or more tasks and to verify that your tasks will update network infrastructure as expected.

Add the -inspect flag to verify all tasks.

Add the -inspect-task flag to inspect a single task. Use multiple flags to verify more than one task.

High availability modeA long-running process that ensures that all changes to Consul that occur during a failover transition are processed and that CTS continues to operate as expected. CTS logs the errors and continues to operate without interruption. Refer to Run Consul-Terraform-Sync with High Availability for additional information.Add the high_availability block to your CTS instance configuration.

Refer to Run Consul-Terraform-Sync with High Availability for additional information.