|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "temporal_schedule Resource - terraform-provider-temporal" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Temporal Schedule resource for managing workflow schedules |
| 7 | +--- |
| 8 | + |
| 9 | +# temporal_schedule (Resource) |
| 10 | + |
| 11 | +Temporal Schedule resource for managing workflow schedules |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +# Manage an example schedule. |
| 17 | +resource "temporal_schedule" "daily_cleanup" { |
| 18 | + namespace = default |
| 19 | + schedule_id = "daily-cleanup-task" |
| 20 | +
|
| 21 | + spec = { |
| 22 | + intervals = [{ |
| 23 | + every = "24h" |
| 24 | + offset = "3h" |
| 25 | + }] |
| 26 | +
|
| 27 | + calendar_items = [{ |
| 28 | + year = "2025" |
| 29 | + month = "1,3,7,11" |
| 30 | + day_of_month = "1,11" |
| 31 | + hour = "11-14" |
| 32 | + }] |
| 33 | +
|
| 34 | + time_zone = "UTC" |
| 35 | + } |
| 36 | +
|
| 37 | + state = {} |
| 38 | +
|
| 39 | + policy_config = { |
| 40 | + catchup_window = "1m" |
| 41 | + } |
| 42 | +
|
| 43 | + action = { |
| 44 | + workflow = { |
| 45 | + workflow_type = "CleanupWorkflow" |
| 46 | + task_queue = "cleanup-queue-1" |
| 47 | + workflow_id = "cleanup-wf-test" |
| 48 | +
|
| 49 | + input = jsonencode({ |
| 50 | + retention_days = 30 |
| 51 | + dry_run = false |
| 52 | + }) |
| 53 | +
|
| 54 | + execution_timeout = "1h" |
| 55 | + run_timeout = "30m" |
| 56 | + task_timeout = "10s" |
| 57 | +
|
| 58 | + retry_policy = { |
| 59 | + initial_interval = "1s" |
| 60 | + backoff_coefficient = 2.0 |
| 61 | + maximum_interval = "100s" |
| 62 | + maximum_attempts = 5 |
| 63 | + } |
| 64 | + } |
| 65 | + } |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +<!-- schema generated by tfplugindocs --> |
| 70 | +## Schema |
| 71 | + |
| 72 | +### Required |
| 73 | + |
| 74 | +- `action` (Attributes) Action to execute on schedule (see [below for nested schema](#nestedatt--action)) |
| 75 | +- `namespace` (String) Namespace where the schedule resides |
| 76 | +- `policy_config` (Attributes) Schedule policy configuration (see [below for nested schema](#nestedatt--policy_config)) |
| 77 | +- `schedule_id` (String) Unique identifier for the schedule |
| 78 | +- `spec` (Attributes) Schedule specification (see [below for nested schema](#nestedatt--spec)) |
| 79 | +- `state` (Attributes) Schedule state (see [below for nested schema](#nestedatt--state)) |
| 80 | + |
| 81 | +### Optional |
| 82 | + |
| 83 | +- `memo` (Map of String) Non-indexed key-value pairs for metadata |
| 84 | + |
| 85 | +<a id="nestedatt--action"></a> |
| 86 | +### Nested Schema for `action` |
| 87 | + |
| 88 | +Required: |
| 89 | + |
| 90 | +- `workflow` (Attributes) Workflow action (see [below for nested schema](#nestedatt--action--workflow)) |
| 91 | + |
| 92 | +<a id="nestedatt--action--workflow"></a> |
| 93 | +### Nested Schema for `action.workflow` |
| 94 | + |
| 95 | +Required: |
| 96 | + |
| 97 | +- `task_queue` (String) Task Queue |
| 98 | +- `workflow_id` (String) Workflow ID |
| 99 | +- `workflow_type` (String) Workflow Type |
| 100 | + |
| 101 | +Optional: |
| 102 | + |
| 103 | +- `execution_timeout` (String) Execution timeout |
| 104 | +- `input` (String) Workflow input (JSON) |
| 105 | +- `run_timeout` (String) Run timeout |
| 106 | +- `task_timeout` (String) Task timeout |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +<a id="nestedatt--policy_config"></a> |
| 111 | +### Nested Schema for `policy_config` |
| 112 | + |
| 113 | +Optional: |
| 114 | + |
| 115 | +- `catchup_window` (String) Maximum catch-up time for when the Service is unavailable |
| 116 | +- `overlap_policy` (String) Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll |
| 117 | +- `pause_on_failure` (Boolean) Pause the schedule on action failure |
| 118 | + |
| 119 | + |
| 120 | +<a id="nestedatt--spec"></a> |
| 121 | +### Nested Schema for `spec` |
| 122 | + |
| 123 | +Optional: |
| 124 | + |
| 125 | +- `calendar_items` (Attributes List) Calendar expressions for schedule (see [below for nested schema](#nestedatt--spec--calendar_items)) |
| 126 | +- `cron_items` (List of String) Traditional cron expressions (e.g. '15 8 * * *') |
| 127 | +- `end_time` (String) End time of the schedule (RFC3339) |
| 128 | +- `intervals` (Attributes List) Time intervals for schedule (see [below for nested schema](#nestedatt--spec--intervals)) |
| 129 | +- `jitter` (String) Jitter duration to add randomness to scheduled times |
| 130 | +- `start_time` (String) Start time of the schedule (RFC3339) |
| 131 | +- `time_zone` (String) Time zone for the schedule |
| 132 | + |
| 133 | +<a id="nestedatt--spec--calendar_items"></a> |
| 134 | +### Nested Schema for `spec.calendar_items` |
| 135 | + |
| 136 | +Optional: |
| 137 | + |
| 138 | +- `comment` (String) Optional comment describing this calendar entry |
| 139 | +- `day_of_month` (String) Day of month specification (e.g., '1', '1,15', '1-31') |
| 140 | +- `day_of_week` (String) Day of week specification in numeric format (e.g., '1', '1-6', '1,3,5') |
| 141 | +- `hour` (String) Hour specification (e.g., '9', '9-17', '11-14') |
| 142 | +- `minute` (String) Minute specification (e.g., '0', '0,30', '*/15', '*') |
| 143 | +- `month` (String) Month specification in numeric format (e.g., '1', '1,2,9', '1-12') |
| 144 | +- `second` (String) Second specification (e.g., '0', '0,30', '*') |
| 145 | +- `year` (String) Year specification (e.g., '2022', '2022-2025') |
| 146 | + |
| 147 | + |
| 148 | +<a id="nestedatt--spec--intervals"></a> |
| 149 | +### Nested Schema for `spec.intervals` |
| 150 | + |
| 151 | +Required: |
| 152 | + |
| 153 | +- `every` (String) Duration of the interval (e.g., '24h', '7d') |
| 154 | + |
| 155 | +Optional: |
| 156 | + |
| 157 | +- `offset` (String) Offset from the interval (e.g., '1h') |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +<a id="nestedatt--state"></a> |
| 162 | +### Nested Schema for `state` |
| 163 | + |
| 164 | +Optional: |
| 165 | + |
| 166 | +- `limited_actions` (Boolean) Whether the schedule is limited to a specific number of actions |
| 167 | +- `notes` (String) Initial notes |
| 168 | +- `paused` (Boolean) Pause the Schedule immediately on creation |
| 169 | +- `remaining_actions` (Number) Total allowed actions |
| 170 | + |
| 171 | +## Import |
| 172 | + |
| 173 | +Import is supported using the following syntax: |
| 174 | + |
| 175 | +```shell |
| 176 | +# A schedule can be imported by specifying 'namespace:schedule_id' |
| 177 | +terraform import temporal_schedule.example_schedule default:example |
| 178 | + |
| 179 | + |
| 180 | +# A schedule can also be imported by specifying just 'schedule_id' ('default' namespace will be used) |
| 181 | +terraform import temporal_schedule.example_schedule example |
| 182 | +``` |
0 commit comments