azurermAutomationSchedule
Manages a Automation Schedule.
Example Usage
/*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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "tfex-automation-account",
}
);
const azurermAutomationAccountExample =
new azurerm.automationAccount.AutomationAccount(this, "example_1", {
location: azurermResourceGroupExample.location,
name: "tfex-automation-account",
resource_group_name: azurermResourceGroupExample.name,
sku_name: "Basic",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationAccountExample.overrideLogicalId("example");
const azurermAutomationScheduleExample =
new azurerm.automationSchedule.AutomationSchedule(this, "example_2", {
automation_account_name: azurermAutomationAccountExample.name,
description: "This is an example schedule",
frequency: "Week",
interval: 1,
name: "tfex-automation-schedule",
resource_group_name: azurermResourceGroupExample.name,
start_time: "2014-04-15T18:00:15+02:00",
timezone: "Australia/Perth",
week_days: ["Friday"],
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationScheduleExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name- (Required) Specifies the name of the Schedule. Changing this forces a new resource to be created. -
resourceGroupName- (Required) The name of the resource group in which the Schedule is created. Changing this forces a new resource to be created. -
automationAccountName- (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 eitheroneTime,day,hour,week, ormonth. -
description- (Optional) A description for this Schedule. -
interval- (Optional) The number offrequencys between runs. Only valid when frequency isday,hour,week, ormonthand defaults to1. -
startTime- (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. -
expiryTime- (Optional) The end time of the schedule. -
timezone- (Optional) The timezone of the start time. Defaults toutc. For possible values see: https://docs.microsoft.com/en-us/rest/api/maps/timezone/gettimezoneenumwindows -
weekDays- (Optional) List of days of the week that the job should execute on. Only valid when frequency isweek. Possible values aremonday,tuesday,wednesday,thursday,friday,saturdayandsunday. -
monthDays- (Optional) List of days of the month that the job should execute on. Must be between1and31.1for last day of the month. Only valid when frequency ismonth. -
monthlyOccurrence- (Optional) List ofmonthlyOccurrenceblocks as defined below to specifies occurrences of days within a month. Only valid when frequency ismonth. ThemonthlyOccurrenceblock supports fields documented below.
The monthlyOccurrence block supports:
-
day- (Required) Day of the occurrence. Must be one ofmonday,tuesday,wednesday,thursday,friday,saturday,sunday. -
occurrence- (Required) Occurrence of the week within the month. Must be between1and5.1for last week within the month.
Attributes Reference
The following attributes are exported:
id- The Automation Schedule ID.
Timeouts
The timeouts block allows you to specify timeouts for certain actions:
create- (Defaults to 30 minutes) Used when creating the Automation Schedule.update- (Defaults to 30 minutes) Used when updating the Automation Schedule.read- (Defaults to 5 minutes) Used when retrieving the Automation Schedule.delete- (Defaults to 30 minutes) Used when deleting the Automation Schedule.
Import
Automation Schedule can be imported using the resourceId, e.g.