We recommend using Azure Native.
azure.automation.JobSchedule
Explore with Pulumi AI
Links an Automation Runbook and Schedule.
NOTE AzureRM provides this stand-alone azure.automation.JobSchedule and an inlined
job_schedule
property in azurerm_runbook to manage the job schedules. You can only make use of one of these methods to manage a job schedule.
Example Usage
This is an example of just the Job Schedule.
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.automation.JobSchedule("example", {
resourceGroupName: "tf-rgr-automation",
automationAccountName: "tf-automation-account",
scheduleName: "hour",
runbookName: "Get-VirtualMachine",
parameters: {
resourcegroup: "tf-rgr-vm",
vmname: "TF-VM-01",
},
});
import pulumi
import pulumi_azure as azure
example = azure.automation.JobSchedule("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",
})
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewJobSchedule(ctx, "example", &automation.JobScheduleArgs{
ResourceGroupName: pulumi.String("tf-rgr-automation"),
AutomationAccountName: pulumi.String("tf-automation-account"),
ScheduleName: pulumi.String("hour"),
RunbookName: pulumi.String("Get-VirtualMachine"),
Parameters: pulumi.StringMap{
"resourcegroup": pulumi.String("tf-rgr-vm"),
"vmname": pulumi.String("TF-VM-01"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Automation.JobSchedule("example", new()
{
ResourceGroupName = "tf-rgr-automation",
AutomationAccountName = "tf-automation-account",
ScheduleName = "hour",
RunbookName = "Get-VirtualMachine",
Parameters =
{
{ "resourcegroup", "tf-rgr-vm" },
{ "vmname", "TF-VM-01" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.automation.JobSchedule;
import com.pulumi.azure.automation.JobScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new JobSchedule("example", JobScheduleArgs.builder()
.resourceGroupName("tf-rgr-automation")
.automationAccountName("tf-automation-account")
.scheduleName("hour")
.runbookName("Get-VirtualMachine")
.parameters(Map.ofEntries(
Map.entry("resourcegroup", "tf-rgr-vm"),
Map.entry("vmname", "TF-VM-01")
))
.build());
}
}
resources:
example:
type: azure:automation:JobSchedule
properties:
resourceGroupName: tf-rgr-automation
automationAccountName: tf-automation-account
scheduleName: hour
runbookName: Get-VirtualMachine
parameters:
resourcegroup: tf-rgr-vm
vmname: TF-VM-01
Create JobSchedule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new JobSchedule(name: string, args: JobScheduleArgs, opts?: CustomResourceOptions);
@overload
def JobSchedule(resource_name: str,
args: JobScheduleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def JobSchedule(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
runbook_name: Optional[str] = None,
schedule_name: Optional[str] = None,
job_schedule_id: Optional[str] = None,
parameters: Optional[Mapping[str, str]] = None,
run_on: Optional[str] = None)
func NewJobSchedule(ctx *Context, name string, args JobScheduleArgs, opts ...ResourceOption) (*JobSchedule, error)
public JobSchedule(string name, JobScheduleArgs args, CustomResourceOptions? opts = null)
public JobSchedule(String name, JobScheduleArgs args)
public JobSchedule(String name, JobScheduleArgs args, CustomResourceOptions options)
type: azure:automation:JobSchedule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args JobScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args JobScheduleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args JobScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args JobScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args JobScheduleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var jobScheduleResource = new Azure.Automation.JobSchedule("jobScheduleResource", new()
{
AutomationAccountName = "string",
ResourceGroupName = "string",
RunbookName = "string",
ScheduleName = "string",
JobScheduleId = "string",
Parameters =
{
{ "string", "string" },
},
RunOn = "string",
});
example, err := automation.NewJobSchedule(ctx, "jobScheduleResource", &automation.JobScheduleArgs{
AutomationAccountName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
RunbookName: pulumi.String("string"),
ScheduleName: pulumi.String("string"),
JobScheduleId: pulumi.String("string"),
Parameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
RunOn: pulumi.String("string"),
})
var jobScheduleResource = new JobSchedule("jobScheduleResource", JobScheduleArgs.builder()
.automationAccountName("string")
.resourceGroupName("string")
.runbookName("string")
.scheduleName("string")
.jobScheduleId("string")
.parameters(Map.of("string", "string"))
.runOn("string")
.build());
job_schedule_resource = azure.automation.JobSchedule("jobScheduleResource",
automation_account_name="string",
resource_group_name="string",
runbook_name="string",
schedule_name="string",
job_schedule_id="string",
parameters={
"string": "string",
},
run_on="string")
const jobScheduleResource = new azure.automation.JobSchedule("jobScheduleResource", {
automationAccountName: "string",
resourceGroupName: "string",
runbookName: "string",
scheduleName: "string",
jobScheduleId: "string",
parameters: {
string: "string",
},
runOn: "string",
});
type: azure:automation:JobSchedule
properties:
automationAccountName: string
jobScheduleId: string
parameters:
string: string
resourceGroupName: string
runOn: string
runbookName: string
scheduleName: string
JobSchedule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The JobSchedule resource accepts the following input properties:
- Automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- Runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- Job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- Parameters Dictionary<string, string>
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.
- Run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- Automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- Runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- Job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- Parameters map[string]string
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.
- Run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- runbook
Name String - 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 String - The name of the Schedule. Changing this forces a new resource to be created.
- job
Schedule StringId - The UUID identifying the Automation Job Schedule.
- parameters Map<String,String>
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.
- run
On String - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- parameters {[key: string]: string}
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.
- run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- automation_
account_ strname - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- runbook_
name str - 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 str - The name of the Schedule. Changing this forces a new resource to be created.
- job_
schedule_ strid - The UUID identifying the Automation Job Schedule.
- parameters Mapping[str, str]
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.
- run_
on str - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- runbook
Name String - 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 String - The name of the Schedule. Changing this forces a new resource to be created.
- job
Schedule StringId - The UUID identifying the Automation Job Schedule.
- parameters Map<String>
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.
- run
On String - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the JobSchedule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Manager StringId - The Resource Manager ID of the Automation Job Schedule.
- id string
- The provider-assigned unique ID for this managed resource.
- resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- id str
- The provider-assigned unique ID for this managed resource.
- resource_
manager_ strid - The Resource Manager ID of the Automation Job Schedule.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Manager StringId - The Resource Manager ID of the Automation Job Schedule.
Look up Existing JobSchedule Resource
Get an existing JobSchedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: JobScheduleState, opts?: CustomResourceOptions): JobSchedule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
job_schedule_id: Optional[str] = None,
parameters: Optional[Mapping[str, str]] = None,
resource_group_name: Optional[str] = None,
resource_manager_id: Optional[str] = None,
run_on: Optional[str] = None,
runbook_name: Optional[str] = None,
schedule_name: Optional[str] = None) -> JobSchedule
func GetJobSchedule(ctx *Context, name string, id IDInput, state *JobScheduleState, opts ...ResourceOption) (*JobSchedule, error)
public static JobSchedule Get(string name, Input<string> id, JobScheduleState? state, CustomResourceOptions? opts = null)
public static JobSchedule get(String name, Output<String> id, JobScheduleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- Job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- Parameters Dictionary<string, string>
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.
- Resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- Resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- Run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- Runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- Automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- Job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- Parameters map[string]string
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.
- Resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- Resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- Run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- Runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- job
Schedule StringId - The UUID identifying the Automation Job Schedule.
- parameters Map<String,String>
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.
- resource
Group StringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Manager StringId - The Resource Manager ID of the Automation Job Schedule.
- run
On String - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- runbook
Name String - 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 String - The name of the Schedule. Changing this forces a new resource to be created.
- automation
Account stringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- job
Schedule stringId - The UUID identifying the Automation Job Schedule.
- parameters {[key: string]: string}
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.
- resource
Group stringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Manager stringId - The Resource Manager ID of the Automation Job Schedule.
- run
On string - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- runbook
Name string - 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 string - The name of the Schedule. Changing this forces a new resource to be created.
- automation_
account_ strname - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- job_
schedule_ strid - The UUID identifying the Automation Job Schedule.
- parameters Mapping[str, str]
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.
- resource_
group_ strname - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource_
manager_ strid - The Resource Manager ID of the Automation Job Schedule.
- run_
on str - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- runbook_
name str - 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 str - The name of the Schedule. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
- job
Schedule StringId - The UUID identifying the Automation Job Schedule.
- parameters Map<String>
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.
- resource
Group StringName - The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
- resource
Manager StringId - The Resource Manager ID of the Automation Job Schedule.
- run
On String - Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
- runbook
Name String - 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 String - The name of the Schedule. Changing this forces a new resource to be created.
Import
Automation Job Schedules can be imported using the resource id
, e.g.
$ pulumi import azure:automation/jobSchedule:JobSchedule example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/schedules/schedule1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/runbooks/runbook1"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.