ContinueOps

    continueops

    by: ContinueOps·Resilience & Disaster Recovery

    Published
    Published 3 days ago
    Version
    0.1.0
    Source
    app.terraform.io/continueops/continueops
    Documentation

    continueops_schedule (Resource)

    A cron schedule that fires a runbook template or a runbook group.

    Set exactly one of template_id or group_id. Either can be changed in place, including switching a schedule from a template to a group or back: the API rewrites the target in one request, so the schedule keeps its id.

    Destroy is a soft delete that also disables the schedule.

    Example Usage

    # Run a group at 06:00 London time on the first of every month,
    # on any runner in the "aws-prod" pool.
    resource "continueops_schedule" "monthly" {
      name        = "Monthly DR"
      group_id    = continueops_runbook_group.monthly_dr.id
      cron_expr   = "0 6 1 * *"
      timezone    = "Europe/London"
      runner_mode = "pool"
      runner_pool = "aws-prod"
      variables = {
        AWS_REGION = "eu-west-2"
      }
    }

    Schema

    Required

    • cron_expr (String) When to fire: a 5-field cron expression (minute hour day-of-month month day-of-week), fields separated by single spaces, e.g. 35 5 * * *. Each field is *, a number or range, optionally with a /step, or a comma-separated list of those.

    Optional

    • enabled (Boolean) Whether the schedule fires. Default true.
    • group_id (String) Id of the continueops_runbook_group to fire. Exactly one of template_id or group_id.
    • name (String) Display name, at most 200 characters.
    • runner_deployment_id (String) Id of an enrolled runner (dep_...). Required when runner_mode is pinned, not allowed otherwise.
    • runner_mode (String) Where runs execute: managed (the platform's own runners), tenant_default (the tenant's default runner), pinned (the runner in runner_deployment_id) or pool (any runner in runner_pool). Default managed.
    • runner_pool (String) Runner pool label. Required when runner_mode is pool, not allowed otherwise.
    • tag_ids (Set of String) Ids of continueops_tags on this schedule, at most 50.
    • template_id (String) Id of the continueops_runbook_template to fire. Exactly one of template_id or group_id.
    • template_version (Number) Pins the run to this version of the template instead of the latest. Only with template_id.
    • then_template_ids (List of String) Templates to run after template_id, in this order (at most 20, no repeats). Only with template_id; for a group, put them in the group instead.
    • timeouts (Attributes) (see below for nested schema)
    • timezone (String) IANA time zone cron_expr is read in, e.g. Europe/London. Default UTC.
    • variables (Map of String) Variables passed to each run, as strings (use tostring() for numbers).

    Read-Only

    • created_at (String) When the schedule was created (RFC 3339, UTC).
    • id (String) Schedule id (UUID).
    • last_error (String) Why the last firing failed, if it did. Set by the platform.
    • last_run_at (String) When the schedule last fired (RFC 3339, UTC); null if it never has. Set by the platform.
    • updated_at (String) When the schedule last changed (RFC 3339, UTC).

    Nested Schema for timeouts

    Optional:

    • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Import is supported using the following syntax:

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    import {
      to = continueops_schedule.example
      id = "00000000-0000-4000-8000-000000000000"
    }

    The terraform import command can be used, for example:

    # Import by id (UUID), shown in the ContinueOps UI and returned by the API.
    terraform import continueops_schedule.example 00000000-0000-4000-8000-000000000000