Links an Automation Runbook and Schedule.
This is an example of just the Job Schedule. A full example of the azurerm_automation_job_schedule
resource can be found in the ./examples/automation-account
directory within the GitHub Repository
resource "azurerm_automation_job_schedule" "example" {
resource_group_name = "tf-rgr-automation"
automation_account_name = "tf-automation-account"
schedule_name = "hour"
runbook_name = "Get-VirtualMachine"
parameters = {
resourcegroup = "tf-rgr-vm"
vmname = "TF-VM-01"
}
}
The following arguments are supported:
resource_group_name
- (Required) The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
automation_account_name
- (Required) The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
runbook_name
- (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.
schedule_name
- (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.
run_on
- (Optional) Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Automation Job Schedule.
job_schedule_id
- (Optional) The UUID identifying the Automation Job Schedule.
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating 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.Automation Job Schedules can be imported using the resource id
, 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