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

com.pulumi.azure.arcmachine.kotlin.ExtensionArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.arcmachine.kotlin

import com.pulumi.azure.arcmachine.ExtensionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Hybrid Compute Machine Extension.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "West Europe",
 * });
 * const example = azure.arcmachine.getOutput({
 *     name: "existing-hcmachine",
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const exampleExtension = new azure.arcmachine.Extension("example", {
 *     name: "example",
 *     location: "West Europe",
 *     arcMachineId: example.apply(example => example.id),
 *     publisher: "Microsoft.Azure.Monitor",
 *     type: "AzureMonitorLinuxAgent",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example_resource_group = azure.core.ResourceGroup("example",
 *     name="example",
 *     location="West Europe")
 * example = azure.arcmachine.get_output(name="existing-hcmachine",
 *     resource_group_name=example_resource_group.name)
 * example_extension = azure.arcmachine.Extension("example",
 *     name="example",
 *     location="West Europe",
 *     arc_machine_id=example.id,
 *     publisher="Microsoft.Azure.Monitor",
 *     type="AzureMonitorLinuxAgent")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example",
 *         Location = "West Europe",
 *     });
 *     var example = Azure.ArcMachine.Get.Invoke(new()
 *     {
 *         Name = "existing-hcmachine",
 *         ResourceGroupName = exampleResourceGroup.Name,
 *     });
 *     var exampleExtension = new Azure.ArcMachine.Extension("example", new()
 *     {
 *         Name = "example",
 *         Location = "West Europe",
 *         ArcMachineId = example.Apply(getResult => getResult.Id),
 *         Publisher = "Microsoft.Azure.Monitor",
 *         Type = "AzureMonitorLinuxAgent",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arcmachine"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example := arcmachine.GetOutput(ctx, arcmachine.GetOutputArgs{
 * 			Name:              pulumi.String("existing-hcmachine"),
 * 			ResourceGroupName: exampleResourceGroup.Name,
 * 		}, nil)
 * 		_, err = arcmachine.NewExtension(ctx, "example", &arcmachine.ExtensionArgs{
 * 			Name:     pulumi.String("example"),
 * 			Location: pulumi.String("West Europe"),
 * 			ArcMachineId: pulumi.String(example.ApplyT(func(example arcmachine.GetResult) (*string, error) {
 * 				return &example.Id, nil
 * 			}).(pulumi.StringPtrOutput)),
 * 			Publisher: pulumi.String("Microsoft.Azure.Monitor"),
 * 			Type:      pulumi.String("AzureMonitorLinuxAgent"),
 * 		})
 * 		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.arcmachine.ArcmachineFunctions;
 * import com.pulumi.azure.arcmachine.inputs.GetArgs;
 * import com.pulumi.azure.arcmachine.Extension;
 * import com.pulumi.azure.arcmachine.ExtensionArgs;
 * 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
 *             .name("example")
 *             .location("West Europe")
 *             .build());
 *         final var example = ArcmachineFunctions.get(GetArgs.builder()
 *             .name("existing-hcmachine")
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 *         var exampleExtension = new Extension("exampleExtension", ExtensionArgs.builder()
 *             .name("example")
 *             .location("West Europe")
 *             .arcMachineId(example.applyValue(getResult -> getResult).applyValue(example -> example.applyValue(getResult -> getResult.id())))
 *             .publisher("Microsoft.Azure.Monitor")
 *             .type("AzureMonitorLinuxAgent")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleResourceGroup:
 *     type: azure:core:ResourceGroup
 *     name: example
 *     properties:
 *       name: example
 *       location: West Europe
 *   exampleExtension:
 *     type: azure:arcmachine:Extension
 *     name: example
 *     properties:
 *       name: example
 *       location: West Europe
 *       arcMachineId: ${example.id}
 *       publisher: Microsoft.Azure.Monitor
 *       type: AzureMonitorLinuxAgent
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:arcmachine:get
 *       Arguments:
 *         name: existing-hcmachine
 *         resourceGroupName: ${exampleResourceGroup.name}
 * ```
 * 
 * ## Import
 * Hybrid Compute Machine Extensions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:arcmachine/extension:Extension example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.HybridCompute/machines/hcmachine1/extensions/ext1
 * ```
 * @property arcMachineId The ID of the Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
 * @property automaticUpgradeEnabled Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. Supported values are `true` and `false`. Defaults to `true`.
 * > **NOTE:** When `automatic_upgrade_enabled` can only be set during creation. Any later change will be ignored.
 * > **NOTE:** When `automatic_upgrade_enabled` is set to `true`, the `type_handler_version` is automatically updated by the Azure platform when a new version is available and any change in `type_handler_version` will be automatically ignored.
 * @property forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed.
 * @property location The Azure Region where the Hybrid Compute Machine Extension should exist. Changing this forces a new Hybrid Compute Machine Extension to be created.
 * @property name The name which should be used for this Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
 * @property protectedSettings Json formatted protected settings for the extension.
 * @property publisher The name of the extension handler publisher, such as `Microsoft.Azure.Monitor`. Changing this forces a new Hybrid Compute Machine Extension to be created.
 * @property settings Json formatted public settings for the extension.
 * @property tags A mapping of tags which should be assigned to the Hybrid Compute Machine Extension.
 * @property type Specifies the type of the extension. For example `CustomScriptExtension` or `AzureMonitorLinuxAgent`. Changing this forces a new Hybrid Compute Machine Extension to be created.
 * @property typeHandlerVersion Specifies the version of the script handler.
 * > **NOTE:** 1. When `automatic_upgrade_enabled` is set to `false` and no `type_handler_version` is specified, the `type_handler_version` change should be manually ignored by `ignore_changes` lifecycle block. This is because the `type_handler_version` is set by the Azure platform when the extension is created. 2. When `automatic_upgrade_enabled` is set to `false` and `type_handler_version` is specified, the provider will check whether the version prefix is aligned with user input. For example, if user specifies `1.24` in `type_handler_version`, `1.24.1` will be considered as no diff.
 */
public data class ExtensionArgs(
    public val arcMachineId: Output? = null,
    public val automaticUpgradeEnabled: Output? = null,
    public val forceUpdateTag: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val protectedSettings: Output? = null,
    public val publisher: Output? = null,
    public val settings: Output? = null,
    public val tags: Output>? = null,
    public val type: Output? = null,
    public val typeHandlerVersion: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.arcmachine.ExtensionArgs =
        com.pulumi.azure.arcmachine.ExtensionArgs.builder()
            .arcMachineId(arcMachineId?.applyValue({ args0 -> args0 }))
            .automaticUpgradeEnabled(automaticUpgradeEnabled?.applyValue({ args0 -> args0 }))
            .forceUpdateTag(forceUpdateTag?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .protectedSettings(protectedSettings?.applyValue({ args0 -> args0 }))
            .publisher(publisher?.applyValue({ args0 -> args0 }))
            .settings(settings?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .type(type?.applyValue({ args0 -> args0 }))
            .typeHandlerVersion(typeHandlerVersion?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ExtensionArgs].
 */
@PulumiTagMarker
public class ExtensionArgsBuilder internal constructor() {
    private var arcMachineId: Output? = null

    private var automaticUpgradeEnabled: Output? = null

    private var forceUpdateTag: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var protectedSettings: Output? = null

    private var publisher: Output? = null

    private var settings: Output? = null

    private var tags: Output>? = null

    private var type: Output? = null

    private var typeHandlerVersion: Output? = null

    /**
     * @param value The ID of the Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("ahyghqqrwuxmdlms")
    public suspend fun arcMachineId(`value`: Output) {
        this.arcMachineId = value
    }

    /**
     * @param value Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. Supported values are `true` and `false`. Defaults to `true`.
     * > **NOTE:** When `automatic_upgrade_enabled` can only be set during creation. Any later change will be ignored.
     * > **NOTE:** When `automatic_upgrade_enabled` is set to `true`, the `type_handler_version` is automatically updated by the Azure platform when a new version is available and any change in `type_handler_version` will be automatically ignored.
     */
    @JvmName("ottrxcgcqsrgjwid")
    public suspend fun automaticUpgradeEnabled(`value`: Output) {
        this.automaticUpgradeEnabled = value
    }

    /**
     * @param value How the extension handler should be forced to update even if the extension configuration has not changed.
     */
    @JvmName("lfystbilbnyvkrvs")
    public suspend fun forceUpdateTag(`value`: Output) {
        this.forceUpdateTag = value
    }

    /**
     * @param value The Azure Region where the Hybrid Compute Machine Extension should exist. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("ylwtvhwlynqulshe")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name which should be used for this Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("bncdbdaxxdrlyulh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Json formatted protected settings for the extension.
     */
    @JvmName("gomfxbqgouyicvtb")
    public suspend fun protectedSettings(`value`: Output) {
        this.protectedSettings = value
    }

    /**
     * @param value The name of the extension handler publisher, such as `Microsoft.Azure.Monitor`. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("nwpyjujlrsbhxkkq")
    public suspend fun publisher(`value`: Output) {
        this.publisher = value
    }

    /**
     * @param value Json formatted public settings for the extension.
     */
    @JvmName("mogdlnpouxgewvae")
    public suspend fun settings(`value`: Output) {
        this.settings = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Hybrid Compute Machine Extension.
     */
    @JvmName("inmjcltithkgormo")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the type of the extension. For example `CustomScriptExtension` or `AzureMonitorLinuxAgent`. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("gyvsdbureftmvelv")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value Specifies the version of the script handler.
     * > **NOTE:** 1. When `automatic_upgrade_enabled` is set to `false` and no `type_handler_version` is specified, the `type_handler_version` change should be manually ignored by `ignore_changes` lifecycle block. This is because the `type_handler_version` is set by the Azure platform when the extension is created. 2. When `automatic_upgrade_enabled` is set to `false` and `type_handler_version` is specified, the provider will check whether the version prefix is aligned with user input. For example, if user specifies `1.24` in `type_handler_version`, `1.24.1` will be considered as no diff.
     */
    @JvmName("kwwvmrgshohnspim")
    public suspend fun typeHandlerVersion(`value`: Output) {
        this.typeHandlerVersion = value
    }

    /**
     * @param value The ID of the Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("tpbhhbcxehhlnuqs")
    public suspend fun arcMachineId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.arcMachineId = mapped
    }

    /**
     * @param value Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. Supported values are `true` and `false`. Defaults to `true`.
     * > **NOTE:** When `automatic_upgrade_enabled` can only be set during creation. Any later change will be ignored.
     * > **NOTE:** When `automatic_upgrade_enabled` is set to `true`, the `type_handler_version` is automatically updated by the Azure platform when a new version is available and any change in `type_handler_version` will be automatically ignored.
     */
    @JvmName("gabjkpjpshrtsqjj")
    public suspend fun automaticUpgradeEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automaticUpgradeEnabled = mapped
    }

    /**
     * @param value How the extension handler should be forced to update even if the extension configuration has not changed.
     */
    @JvmName("orbjaorxosueidpk")
    public suspend fun forceUpdateTag(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forceUpdateTag = mapped
    }

    /**
     * @param value The Azure Region where the Hybrid Compute Machine Extension should exist. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("omyoyeskikvxlmca")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name which should be used for this Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("rbhxccfqixikxjdy")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Json formatted protected settings for the extension.
     */
    @JvmName("myoaxfsdxbveodxm")
    public suspend fun protectedSettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protectedSettings = mapped
    }

    /**
     * @param value The name of the extension handler publisher, such as `Microsoft.Azure.Monitor`. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("pvdbhmaoqmcrrosc")
    public suspend fun publisher(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publisher = mapped
    }

    /**
     * @param value Json formatted public settings for the extension.
     */
    @JvmName("xondiahmoddxfuxw")
    public suspend fun settings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.settings = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Hybrid Compute Machine Extension.
     */
    @JvmName("ftoxxxxuyhkxrhru")
    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 which should be assigned to the Hybrid Compute Machine Extension.
     */
    @JvmName("iugutdmkhqhywned")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Specifies the type of the extension. For example `CustomScriptExtension` or `AzureMonitorLinuxAgent`. Changing this forces a new Hybrid Compute Machine Extension to be created.
     */
    @JvmName("jywbvustyydxrxup")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value Specifies the version of the script handler.
     * > **NOTE:** 1. When `automatic_upgrade_enabled` is set to `false` and no `type_handler_version` is specified, the `type_handler_version` change should be manually ignored by `ignore_changes` lifecycle block. This is because the `type_handler_version` is set by the Azure platform when the extension is created. 2. When `automatic_upgrade_enabled` is set to `false` and `type_handler_version` is specified, the provider will check whether the version prefix is aligned with user input. For example, if user specifies `1.24` in `type_handler_version`, `1.24.1` will be considered as no diff.
     */
    @JvmName("chwysqkuemjwywqi")
    public suspend fun typeHandlerVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.typeHandlerVersion = mapped
    }

    internal fun build(): ExtensionArgs = ExtensionArgs(
        arcMachineId = arcMachineId,
        automaticUpgradeEnabled = automaticUpgradeEnabled,
        forceUpdateTag = forceUpdateTag,
        location = location,
        name = name,
        protectedSettings = protectedSettings,
        publisher = publisher,
        settings = settings,
        tags = tags,
        type = type,
        typeHandlerVersion = typeHandlerVersion,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy