com.pulumi.azure.automation.kotlin.JobSchedule.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.automation.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
/**
* Builder for [JobSchedule].
*/
@PulumiTagMarker
public class JobScheduleResourceBuilder internal constructor() {
public var name: String? = null
public var args: JobScheduleArgs = JobScheduleArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend JobScheduleArgsBuilder.() -> Unit) {
val builder = JobScheduleArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): JobSchedule {
val builtJavaResource = com.pulumi.azure.automation.JobSchedule(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return JobSchedule(builtJavaResource)
}
}
/**
* Links an Automation Runbook and Schedule.
* ## Example Usage
* This is an example of just the Job Schedule.
*
* ```typescript
* 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",
* },
* });
* ```
* ```python
* 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",
* })
* ```
* ```csharp
* 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" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## Import
* Automation Job Schedules can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:automation/jobSchedule:JobSchedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/jobSchedules/10000000-1001-1001-1001-000000000001
* ```
*/
public class JobSchedule internal constructor(
override val javaResource: com.pulumi.azure.automation.JobSchedule,
) : KotlinCustomResource(javaResource, JobScheduleMapper) {
/**
* The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
*/
public val automationAccountName: Output
get() = javaResource.automationAccountName().applyValue({ args0 -> args0 })
/**
* (Optional) The UUID identifying the Automation Job Schedule.
*/
public val jobScheduleId: Output
get() = javaResource.jobScheduleId().applyValue({ args0 -> args0 })
/**
* 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.
*/
public val parameters: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy