» azurerm_automation_schedule

Manages a Automation Schedule.

» Example Usage

resource "azurerm_resource_group" "example" {
 name     = "tfex-automation-account"
 location = "West Europe"
}

resource "azurerm_automation_account" "example" {
  name                = "tfex-automation-account"
  location            = "${azurerm_resource_group.example.location}"
  resource_group_name = "${azurerm_resource_group.example.name}"
  sku {
    name = "Basic"
  }
}

resource "azurerm_automation_schedule" "example" {
  name                    = "tfex-automation-schedule"
  resource_group_name     = "${azurerm_resource_group.example.name}"
  automation_account_name = "${azurerm_automation_account.example.name}"
  frequency               = "Week"
  interval                = 1
  timezone                = "Central Europe Standard Time"
  start_time              = "2014-04-15T18:00:15+02:00"
  description             = "This is an example schedule"

  advanced_schedule {
    week_days = ["Friday"]
  }
}

» Argument Reference

The following arguments are supported:

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

  • resource_group_name - (Required) The name of the resource group in which the 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 Schedule is created. Changing this forces a new resource to be created.

  • frequency - (Required) The frequency of the schedule. - can be either OneTime, Day, Hour, Week, or Month.

  • description - (Optional) A description for this Schedule.

  • interval - (Optional) The number of frequencys between runs. Only valid when frequency is Day, Hour, Week, or Month and defaults to 1.

  • start_time - (Optional) Start time of the schedule. Must be at least five minutes in the future. Defaults to seven minutes in the future from the time the resource is created.

  • expiry_time - (Optional) The end time of the schedule.

  • timezone - (Optional) The timezone of the start time. Defaults to UTC. For possible values see: https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx

  • week_days - (Optional) List of days of the week that the job should execute on. Only valid when frequency is Week.

  • month_days - (Optional) List of days of the month that the job should execute on. Must be between 1 and 31. -1 for last day of the month. Only valid when frequency is Month.

  • monthly_occurrence - (Optional) List of occurrences of days within a month. Only valid when frequency is Month. The monthly_occurrence block supports fields documented below.


The monthly_occurrence block supports:

  • day - (Required) Day of the occurrence. Must be one of Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

  • occurrence - (Required) Occurrence of the week within the month. Must be between 1 and 5. -1 for last week within the month.

» Attributes Reference

The following attributes are exported:

  • id - The Automation Schedule ID.

» Import

Automation Schedule can be imported using the resource id, e.g.

terraform import azurerm_automation_schedule.schedule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/schedules/schedule1