All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.automation.kotlin.JobScheduleArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.automation.kotlin

import com.pulumi.azure.automation.JobScheduleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Links an Automation Runbook and Schedule.
 * > **NOTE** AzureRM provides this stand-alone azure.automation.JobSchedule and an inlined `job_schdule` 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.
 * 
 * ```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/schedules/schedule1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/runbooks/runbook1"
 * ```
 * @property automationAccountName The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
 * @property jobScheduleId The UUID identifying the Automation Job Schedule.
 * @property parameters 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.
 * @property resourceGroupName The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
 * @property runOn Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
 * @property runbookName 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.
 * @property scheduleName The name of the Schedule. Changing this forces a new resource to be created.
 */
public data class JobScheduleArgs(
    public val automationAccountName: Output? = null,
    public val jobScheduleId: Output? = null,
    public val parameters: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val runOn: Output? = null,
    public val runbookName: Output? = null,
    public val scheduleName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.automation.JobScheduleArgs =
        com.pulumi.azure.automation.JobScheduleArgs.builder()
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .jobScheduleId(jobScheduleId?.applyValue({ args0 -> args0 }))
            .parameters(
                parameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .runOn(runOn?.applyValue({ args0 -> args0 }))
            .runbookName(runbookName?.applyValue({ args0 -> args0 }))
            .scheduleName(scheduleName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [JobScheduleArgs].
 */
@PulumiTagMarker
public class JobScheduleArgsBuilder internal constructor() {
    private var automationAccountName: Output? = null

    private var jobScheduleId: Output? = null

    private var parameters: Output>? = null

    private var resourceGroupName: Output? = null

    private var runOn: Output? = null

    private var runbookName: Output? = null

    private var scheduleName: Output? = null

    /**
     * @param value The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
     */
    @JvmName("jkjchcjwxyydkhbq")
    public suspend fun automationAccountName(`value`: Output) {
        this.automationAccountName = value
    }

    /**
     * @param value The UUID identifying the Automation Job Schedule.
     */
    @JvmName("muborsruencelhuu")
    public suspend fun jobScheduleId(`value`: Output) {
        this.jobScheduleId = value
    }

    /**
     * @param value 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.
     */
    @JvmName("htqgbodofjeasgyi")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

    /**
     * @param value The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
     */
    @JvmName("kuhsvdhvqjdxjjjy")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
     */
    @JvmName("pxxfdcuuarqoqxll")
    public suspend fun runOn(`value`: Output) {
        this.runOn = value
    }

    /**
     * @param value 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.
     */
    @JvmName("gtoiugowssosypsa")
    public suspend fun runbookName(`value`: Output) {
        this.runbookName = value
    }

    /**
     * @param value The name of the Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("umbiwgmivgvmwved")
    public suspend fun scheduleName(`value`: Output) {
        this.scheduleName = value
    }

    /**
     * @param value The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
     */
    @JvmName("amojdalhtttrsvao")
    public suspend fun automationAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automationAccountName = mapped
    }

    /**
     * @param value The UUID identifying the Automation Job Schedule.
     */
    @JvmName("hgsesuvuanxtbaqe")
    public suspend fun jobScheduleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobScheduleId = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("hicmilyflheyxtjk")
    public suspend fun parameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param values 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.
     */
    @JvmName("pixlnivupgnrgubj")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
     */
    @JvmName("qllbilofrttbjmaa")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
     */
    @JvmName("gpryqaqorrqlkbsq")
    public suspend fun runOn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runOn = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("wjrjjohhteabpbok")
    public suspend fun runbookName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runbookName = mapped
    }

    /**
     * @param value The name of the Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("rhdqnfhegkehmgww")
    public suspend fun scheduleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scheduleName = mapped
    }

    internal fun build(): JobScheduleArgs = JobScheduleArgs(
        automationAccountName = automationAccountName,
        jobScheduleId = jobScheduleId,
        parameters = parameters,
        resourceGroupName = resourceGroupName,
        runOn = runOn,
        runbookName = runbookName,
        scheduleName = scheduleName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy