| page_title | morpheus_task_job Resource - terraform-provider-morpheus |
|---|---|
| subcategory | |
| description | Provides a task job resource |
Provides a task job resource
Manual
data "morpheus_task" "example_task" {
name = "Deploy app"
}
resource "morpheus_task_job" "tf_example_task_job_manual" {
name = "TF Example Task Job Manual"
enabled = true
labels = ["aws", "demo"]
task_id = data.morpheus_task.example_task.id
schedule_mode = "manual"
context_type = "instance-label"
instance_label = "demo"
}Date and Time
data "morpheus_task" "example_task" {
name = "Deploy app"
}
resource "morpheus_task_job" "tf_example_task_job_date_and_time" {
name = "TF Example Task Job Date and Time"
enabled = true
labels = ["aws", "demo"]
task_id = data.morpheus_task.example_task.id
schedule_mode = "date_and_time"
scheduled_date_and_time = "2022-12-30T06:00:00Z"
context_type = "instance"
instance_ids = [1, 2]
}Execution Schedule
data "morpheus_task" "example_task" {
name = "Deploy app"
}
data "morpheus_execute_schedule" "example_schedule" {
name = "Run Daily at 9 AM"
}
resource "morpheus_task_job" "tf_example_task_job_schedule" {
name = "TF Example Task Job Schedule"
enabled = true
labels = ["aws", "demo"]
task_id = data.morpheus_task.example_task.id
schedule_mode = "scheduled"
execution_schedule_id = data.morpheus_execute_schedule.jobtest.id
context_type = "instance"
instance_ids = [91]
custom_config = "{\"test\":\"new\"}"
}context_type(String) The context that the job should run as (appliance, server, instance, instance-label, server-label)name(String) The name of the task jobschedule_mode(String) The job scheduling type (manual, date_and_time, scheduled)task_id(Number) The id of the task associated with the job
custom_config(String) The task custom configurationenabled(Boolean) Whether the task job is enabledexecution_schedule_id(Number) The id of the execution schedule associated with the jobinstance_ids(List of Number) A list of instance ids to associate with the jobinstance_label(String) The instance label used for dynamic automation targetinglabels(Set of String) The organization labels associated with the task job (Only supported on Morpheus 5.5.3 or higher)scheduled_date_and_time(String) The date and time the job will be executed if schedule mode date_and_time is usedserver_ids(List of Number) A list of server ids to associate with the jobserver_label(String) The server label used for dynamic automation targeting
id(String) The ID of the task job
Import is supported using the following syntax:
terraform import morpheus_task_job.tf_example_task_job 1