task

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:

  • task_name - (string: required) The name of the task to enable

Options: Currently only supporting general options

Example

  1. $ consul-terraform-sync task enable task_a
  2. ==> Inspecting changes to resource if enabling 'task_a'...
  3. Generating plan that Consul Terraform Sync will use Terraform to execute
  4. An execution plan has been generated and is shown below.
  5. Resource actions are indicated with the following symbols:
  6. + create
  7. Terraform will perform the following actions:
  8. // <diff truncated>
  9. Plan: 3 to add, 0 to change, 0 to destroy.
  10. ==> Enabling the task will perform the actions described above.
  11. Do you want to perform these actions for 'task_a'?
  12. - This action cannot be undone.
  13. - Consul Terraform Sync cannot guarantee Terraform will perform
  14. these exact actions if monitored services have changed.
  15. Only 'yes' will be accepted to approve.
  16. Enter a value: yes
  17. ==> Enabling and running 'task_a'...
  18. ==> 'task_a' enable complete!

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:

  • task_name - (string: required) The name of the task to disable

Options: Currently only supporting general options

Example

  1. $ consul-terraform-sync task disable task_b
  2. ==> Waiting to disable 'task_b'...
  3. ==> 'task_b' disable complete!