Skip to content

azurermAutomationJobSchedule

Links an Automation Runbook and Schedule.

Example Usage

This is an example of just the Job Schedule. A full example of the azurermAutomationJobSchedule resource can be found in the /examples/automationAccount directory within the GitHub Repository

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.automationJobSchedule.AutomationJobSchedule(this, "example", {
  automation_account_name: "tf-automation-account",
  parameters: [
    {
      resourcegroup: "tf-rgr-vm",
      vmname: "TF-VM-01",
    },
  ],
  resource_group_name: "tf-rgr-automation",
  runbook_name: "Get-VirtualMachine",
  schedule_name: "hour",
});

Argument Reference

The following arguments are supported:

  • resourceGroupName - (Required) The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.

  • automationAccountName - (Required) The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.

  • runbookName - (Required) The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.

  • scheduleName - (Required) The name of the Schedule. Changing this forces a new resource to be created.

  • parameters - (Optional) A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

-> NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

  • runOn - (Optional) Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Automation Job Schedule.

  • jobScheduleId - (Optional) The UUID identifying the Automation Job Schedule.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Automation Job Schedule.
  • update - (Defaults to 30 minutes) Used when updating the Automation Job Schedule.
  • read - (Defaults to 5 minutes) Used when retrieving the Automation Job Schedule.
  • delete - (Defaults to 30 minutes) Used when deleting the Automation Job Schedule.

Import

Automation Job Schedules can be imported using the resourceId, e.g.

terraform import azurerm_automation_job_schedule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/jobSchedules/10000000-1001-1001-1001-000000000001