task
task create
task create
command creates a new task so that it will run and update task resources. The command generates and outputs a Terraform plan, similar to inspect-mode, of how resources will be modified if the task is created. The command will then ask for user approval before creating the task.
It is not to be used for updating a task and will not create a task if the task name already exists.
Usage
consul-terraform-sync task create [options] -task-file=<task config>
Options:
In addition to general options this command also supports the following:
Name | Required | Type | Description |
---|---|---|---|
-task-file | Required | string | The path to the task configuration file. See configuration information for details. |
-auto-approve | Optional | boolean | Whether to skip the interactive approval of the plan before creating. |
Example
task_example.hcl:
Shell Session:
task enable
task enable
command enables an existing task so that it will run and update task resources. If the task is already enabled, it will return a success. The command generates and outputs a Terraform plan, similar to inspect-mode, of how resources will be modified if task becomes enabled. If resources changes are detected, the command will ask for user approval before enabling the task. If no resources are detected, the command will go ahead and enable the task.
Usage
consul-terraform-sync task enable [options] <task_name>
Arguments:
Name | Required | Type | Description |
---|---|---|---|
task_name | Required | string | The name of the task to enable. |
Options:
In addition to general options this command also supports the following:
Name | Required | Type | Description |
---|---|---|---|
-auto-approve | Optional | boolean | Whether to skip the interactive approval of the plan before enabling. |
Example
task disable
task disable
command disables an existing task so that it will no longer run and update task resources. If the task is already disabled, it will return a success.
Usage
consul-terraform-sync task disable [options] <task_name>
Arguments:
Name | Required | Type | Description |
---|---|---|---|
task_name | Required | string | The name of the task to disable. |
Options: Currently only supporting general options
Example
task delete
task delete
command deletes an existing task. The command will ask the user for approval before deleting the task. The task will be marked for deletion and will be deleted immediately if it is not running. Otherwise, the task will be deleted once it has completed.
Note: Deleting a task will not destroy the infrastructure managed by the task.
Usage
consul-terraform-sync task delete [options] <task_name>
Arguments:
Name | Required | Type | Description |
---|---|---|---|
task_name | Required | string | The name of the task to delete. |
Options:
In addition to general options this command also supports the following:
Name | Required | Type | Description |
---|---|---|---|
-auto-approve | Optional | boolean | Whether to skip the interactive approval of the task deletion. |
Example