consul/website/content/docs/nia/cli/start.mdx

63 lines
3.7 KiB
Plaintext
Raw Normal View History

Nia/docs 0.6.0 (#13107) * updated docs - added docs for start command - deprecated running without a command - added instructions for autocomplete setup * addressed review comments * addressed review comments * addressed review comments * docs/nia: Terraform Cloud agent support - Add agent as a supported execution mode - Add terraform_cloud_workspace configuration - Deprecate existing terraform_version config * license block docs * added HCP Consul to compatibility * added HCP instructions * addressed review comments * added new auto-retrieval behavior to license docs * addressed review comments * addressed review comments * Apply suggestions from code review * Apply suggestions from code review * updated docs * updated docs * Apply suggestions from code review Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * fixed heading types * fixed heading types * update docs * docs/nia: Add service registration configurations * docs/nia: Style guide updates * docs/nia: Update with beta docs feedback * docs/nia: Update license config formatting Other top-level blocks aren't included in the list of global config options, so removed the liciense entry. * docs/nia: Add auto-retrieval section to license page * docs/nia: Separate column for HCP Consul support * docs/nia: Compatiblity version upper bounds * docs/nia: Fix broken links * docs/nia: Style guide fixes Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * Remove RequestId field from cts health api docs. * docs/nia - Update CTS service id format (#13125) * docs/nia: Convert Consul config to table format * docs/nia: Add ACL token policy requirements * update docs (#13174) * docs/nia: Fix ca_path, key default, and some links * docs/nia: Add CTS service address config * Update website/content/docs/nia/cli/index.mdx * docs/nia: update for 0.6 GA (#13191) Co-authored-by: devarshishah3 <devarshishah3@gmail.com> Co-authored-by: Michael Wilkerson <62034708+wilkermichael@users.noreply.github.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Melissa Kam <mkam@hashicorp.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Melissa Kam <3768460+mkam@users.noreply.github.com> Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com> Co-authored-by: lornasong <lornasong@users.noreply.github.com> Co-authored-by: hashi-derek <105233703+hashi-derek@users.noreply.github.com> Co-authored-by: devarshishah3 <devarshishah3@gmail.com>
2022-05-25 18:23:43 +00:00
---
layout: docs
page_title: Start Command
description: >-
Consul-Terraform-Sync supports start command for starting CTS as a daemon
---
# start
The `start` command starts Consul-Terraform-Sync (CTS) as a daemon. 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:
```shell-session
$ consul-terraform-sync start -config-file=config.hcl
```
To review a list of available flags, use the `-help` or `-h` flag.
## Modes
CTS can be run as a daemon in different modes.
### Long-running Mode
Flag: none
Behavior: This is the default mode in which CTS passes through a once-mode phase and then turns into a long-running process. During the once-mode phase, the daemon will exit with a non-zero status if it encounters an error. After successfully passing through once-mode phase, it will begin a long-running process in which errors are logged and exiting is not expected behavior. When the long-running process begins, CTS daemon starts serving API and command requests.
### Inspect Mode
Flag: `-inspect`
Behavior: CTS will display the proposed state changes for all tasks once and exit. No changes are applied in this mode. On encountering an error before completing, CTS will exit with a non-zero status.
Usage: Intended to be run before long-running mode in order to confirm configuration is accurate and tasks would update network infrastructure as expected.
---
Flag: `-inspect-task [task-name]`
Behavior: This has similar behavior as `-inspect` mode for the selected task. The flag can be specified multiple times to inspect multiple tasks. No changes are applied in this mode.
Usage: Useful to debug one or more tasks to confirm configuration is accurate and the selected tasks would update network infrastructure as expected.
### Once Mode
Flag: `-once`
Behavior: CTS will run all tasks once with buffer periods disabled and exit. On encountering an error before completing, CTS will exit with a non-zero status.
Usage: Intended to be run before long-running mode in order to confirm configuration is accurate and tasks update network infrastructure as expected.
## Options
The `start` command supports the following options:
| Name | Required | Type | Description |Default |
| --------------- | -------- | ------- | ------------------------------- | ----------------------- |
| `-config-dir ` &nbsp; &nbsp; &nbsp;| Required when`-config-file` is not set | string | A directory to load files for configuring CTS. Configuration files require an .hcl or .json file extension in order to specify their format. This option can be specified multiple times to load different directories. | none |
| `-config-file` &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Required when `-config-dir` is not set | string | A file to load for configuring CTS. Configuration file requires an .hcl or .json extension in order to specify their format. This option can be specified multiple times to load different configuration files. | none |
| `-inspect` | Optional | boolean | Run CTS in Inspect mode to print the proposed state changes for all tasks, and then exit. No changes are applied in this mode. | false |
| `-inspect-task` &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Optional | string | Run CTS in Inspect mode to print the proposed state changes for the task, and then exit. The flag can be specified multiple times to inspect multiple tasks. No changes are applied in this mode. | none |
| `-once` | Optional | boolean | Render templates and run tasks once. Does not start the process in long-running mode and disables buffer periods. | false |