![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.arcmachine.kotlin.Extension.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.arcmachine.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 [Extension].
*/
@PulumiTagMarker
public class ExtensionResourceBuilder internal constructor() {
public var name: String? = null
public var args: ExtensionArgs = ExtensionArgs()
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 ExtensionArgsBuilder.() -> Unit) {
val builder = ExtensionArgsBuilder()
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(): Extension {
val builtJavaResource = com.pulumi.azure.arcmachine.Extension(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Extension(builtJavaResource)
}
}
/**
* 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
* ```
*/
public class Extension internal constructor(
override val javaResource: com.pulumi.azure.arcmachine.Extension,
) : KotlinCustomResource(javaResource, ExtensionMapper) {
/**
* The ID of the Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
*/
public val arcMachineId: Output
get() = javaResource.arcMachineId().applyValue({ args0 -> args0 })
/**
* 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.
*/
public val automaticUpgradeEnabled: Output?
get() = javaResource.automaticUpgradeEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* How the extension handler should be forced to update even if the extension configuration has not changed.
*/
public val forceUpdateTag: Output?
get() = javaResource.forceUpdateTag().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Azure Region where the Hybrid Compute Machine Extension should exist. Changing this forces a new Hybrid Compute Machine Extension to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The name which should be used for this Hybrid Compute Machine Extension. Changing this forces a new Hybrid Compute Machine Extension to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Json formatted protected settings for the extension.
*/
public val protectedSettings: Output?
get() = javaResource.protectedSettings().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the extension handler publisher, such as `Microsoft.Azure.Monitor`. Changing this forces a new Hybrid Compute Machine Extension to be created.
*/
public val publisher: Output
get() = javaResource.publisher().applyValue({ args0 -> args0 })
/**
* Json formatted public settings for the extension.
*/
public val settings: Output?
get() = javaResource.settings().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* A mapping of tags which should be assigned to the Hybrid Compute Machine Extension.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy