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

com.pulumi.azure.maintenance.kotlin.ConfigurationArgs.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.maintenance.kotlin

import com.pulumi.azure.maintenance.ConfigurationArgs.builder
import com.pulumi.azure.maintenance.kotlin.inputs.ConfigurationInstallPatchesArgs
import com.pulumi.azure.maintenance.kotlin.inputs.ConfigurationInstallPatchesArgsBuilder
import com.pulumi.azure.maintenance.kotlin.inputs.ConfigurationWindowArgs
import com.pulumi.azure.maintenance.kotlin.inputs.ConfigurationWindowArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a maintenance configuration.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleConfiguration = new azure.maintenance.Configuration("example", {
 *     name: "example-mc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     scope: "SQLDB",
 *     tags: {
 *         Env: "prod",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_configuration = azure.maintenance.Configuration("example",
 *     name="example-mc",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     scope="SQLDB",
 *     tags={
 *         "Env": "prod",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleConfiguration = new Azure.Maintenance.Configuration("example", new()
 *     {
 *         Name = "example-mc",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Scope = "SQLDB",
 *         Tags =
 *         {
 *             { "Env", "prod" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = maintenance.NewConfiguration(ctx, "example", &maintenance.ConfigurationArgs{
 * 			Name:              pulumi.String("example-mc"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Scope:             pulumi.String("SQLDB"),
 * 			Tags: pulumi.StringMap{
 * 				"Env": pulumi.String("prod"),
 * 			},
 * 		})
 * 		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.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.maintenance.Configuration;
 * import com.pulumi.azure.maintenance.ConfigurationArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleConfiguration = new Configuration("exampleConfiguration", ConfigurationArgs.builder()
 *             .name("example-mc")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .scope("SQLDB")
 *             .tags(Map.of("Env", "prod"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleConfiguration:
 *     type: azure:maintenance:Configuration
 *     name: example
 *     properties:
 *       name: example-mc
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       scope: SQLDB
 *       tags:
 *         Env: prod
 * ```
 * 
 * ## Import
 * Maintenance Configuration can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:maintenance/configuration:Configuration example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Maintenance/maintenanceConfigurations/example-mc
 * ```
 * @property inGuestUserPatchMode The in guest user patch mode. Possible values are `Platform` or `User`. Must be specified when `scope` is `InGuestPatch`.
 * @property installPatches An `install_patches` block as defined below.
 * > **NOTE:** `install_patches` must be specified when `scope` is `InGuestPatch`.
 * @property location Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Maintenance Configuration. Changing this forces a new resource to be created.
 * @property properties A mapping of properties to assign to the resource.
 * @property resourceGroupName The name of the Resource Group where the Maintenance Configuration should exist. Changing this forces a new resource to be created.
 * @property scope The scope of the Maintenance Configuration. Possible values are `Extension`, `Host`, `InGuestPatch`, `OSImage`, `SQLDB` or `SQLManagedInstance`.
 * @property tags A mapping of tags to assign to the resource. The key could not contain upper case letter.
 * @property visibility The visibility of the Maintenance Configuration. The only allowable value is `Custom`. Defaults to `Custom`.
 * @property window A `window` block as defined below.
 */
public data class ConfigurationArgs(
    public val inGuestUserPatchMode: Output? = null,
    public val installPatches: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val properties: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val scope: Output? = null,
    public val tags: Output>? = null,
    public val visibility: Output? = null,
    public val window: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.maintenance.ConfigurationArgs =
        com.pulumi.azure.maintenance.ConfigurationArgs.builder()
            .inGuestUserPatchMode(inGuestUserPatchMode?.applyValue({ args0 -> args0 }))
            .installPatches(installPatches?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .properties(
                properties?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .visibility(visibility?.applyValue({ args0 -> args0 }))
            .window(window?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [ConfigurationArgs].
 */
@PulumiTagMarker
public class ConfigurationArgsBuilder internal constructor() {
    private var inGuestUserPatchMode: Output? = null

    private var installPatches: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var properties: Output>? = null

    private var resourceGroupName: Output? = null

    private var scope: Output? = null

    private var tags: Output>? = null

    private var visibility: Output? = null

    private var window: Output? = null

    /**
     * @param value The in guest user patch mode. Possible values are `Platform` or `User`. Must be specified when `scope` is `InGuestPatch`.
     */
    @JvmName("sdkircaqrnynkytd")
    public suspend fun inGuestUserPatchMode(`value`: Output) {
        this.inGuestUserPatchMode = value
    }

    /**
     * @param value An `install_patches` block as defined below.
     * > **NOTE:** `install_patches` must be specified when `scope` is `InGuestPatch`.
     */
    @JvmName("krfbolcxyadqhijx")
    public suspend fun installPatches(`value`: Output) {
        this.installPatches = value
    }

    /**
     * @param value Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("ltcthtnrvmmqftpy")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the Maintenance Configuration. Changing this forces a new resource to be created.
     */
    @JvmName("qoaxmyrilbmkvogj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A mapping of properties to assign to the resource.
     */
    @JvmName("yjberhfihwfypelu")
    public suspend fun properties(`value`: Output>) {
        this.properties = value
    }

    /**
     * @param value The name of the Resource Group where the Maintenance Configuration should exist. Changing this forces a new resource to be created.
     */
    @JvmName("pvewcbruufdefjuo")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The scope of the Maintenance Configuration. Possible values are `Extension`, `Host`, `InGuestPatch`, `OSImage`, `SQLDB` or `SQLManagedInstance`.
     */
    @JvmName("pfmduojwslrriqkw")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value A mapping of tags to assign to the resource. The key could not contain upper case letter.
     */
    @JvmName("mvrdagvskgdysmnf")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The visibility of the Maintenance Configuration. The only allowable value is `Custom`. Defaults to `Custom`.
     */
    @JvmName("msiheuewuudeqmsk")
    public suspend fun visibility(`value`: Output) {
        this.visibility = value
    }

    /**
     * @param value A `window` block as defined below.
     */
    @JvmName("gppgjhoqqcporujk")
    public suspend fun window(`value`: Output) {
        this.window = value
    }

    /**
     * @param value The in guest user patch mode. Possible values are `Platform` or `User`. Must be specified when `scope` is `InGuestPatch`.
     */
    @JvmName("madauofblhjsgadl")
    public suspend fun inGuestUserPatchMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inGuestUserPatchMode = mapped
    }

    /**
     * @param value An `install_patches` block as defined below.
     * > **NOTE:** `install_patches` must be specified when `scope` is `InGuestPatch`.
     */
    @JvmName("fkpsxahlgbtuduug")
    public suspend fun installPatches(`value`: ConfigurationInstallPatchesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.installPatches = mapped
    }

    /**
     * @param argument An `install_patches` block as defined below.
     * > **NOTE:** `install_patches` must be specified when `scope` is `InGuestPatch`.
     */
    @JvmName("mirwyqnfobewmqdv")
    public suspend fun installPatches(argument: suspend ConfigurationInstallPatchesArgsBuilder.() -> Unit) {
        val toBeMapped = ConfigurationInstallPatchesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.installPatches = mapped
    }

    /**
     * @param value Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("rlbkguyxvasrkxig")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

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

    /**
     * @param value A mapping of properties to assign to the resource.
     */
    @JvmName("fbkmuxgbmxlkkstk")
    public suspend fun properties(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param values A mapping of properties to assign to the resource.
     */
    @JvmName("rektlivtkvutnvhc")
    public fun properties(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param value The name of the Resource Group where the Maintenance Configuration should exist. Changing this forces a new resource to be created.
     */
    @JvmName("podsxpbpjcyufdjk")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The scope of the Maintenance Configuration. Possible values are `Extension`, `Host`, `InGuestPatch`, `OSImage`, `SQLDB` or `SQLManagedInstance`.
     */
    @JvmName("moxxqeggxwbmaugp")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource. The key could not contain upper case letter.
     */
    @JvmName("acyxkhcxnlttfjfy")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource. The key could not contain upper case letter.
     */
    @JvmName("cweencjsrowwyxxc")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The visibility of the Maintenance Configuration. The only allowable value is `Custom`. Defaults to `Custom`.
     */
    @JvmName("mrkramjkijjyssdb")
    public suspend fun visibility(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.visibility = mapped
    }

    /**
     * @param value A `window` block as defined below.
     */
    @JvmName("wljkswdhuvlkflgc")
    public suspend fun window(`value`: ConfigurationWindowArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.window = mapped
    }

    /**
     * @param argument A `window` block as defined below.
     */
    @JvmName("dblajwfwainywbnt")
    public suspend fun window(argument: suspend ConfigurationWindowArgsBuilder.() -> Unit) {
        val toBeMapped = ConfigurationWindowArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.window = mapped
    }

    internal fun build(): ConfigurationArgs = ConfigurationArgs(
        inGuestUserPatchMode = inGuestUserPatchMode,
        installPatches = installPatches,
        location = location,
        name = name,
        properties = properties,
        resourceGroupName = resourceGroupName,
        scope = scope,
        tags = tags,
        visibility = visibility,
        window = window,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy