MachineExtensionArgs

data class MachineExtensionArgs(val autoUpgradeMinorVersion: Output<Boolean>? = null, val enableAutomaticUpgrade: Output<Boolean>? = null, val extensionName: Output<String>? = null, val forceUpdateTag: Output<String>? = null, val location: Output<String>? = null, val protectedSettings: Output<Any>? = null, val publisher: Output<String>? = null, val resourceGroupName: Output<String>? = null, val settings: Output<Any>? = null, val tags: Output<Map<String, String>>? = null, val type: Output<String>? = null, val typeHandlerVersion: Output<String>? = null, val virtualMachineName: Output<String>? = null) : ConvertibleToJava<MachineExtensionArgs>

Describes a Machine Extension. Uses Azure REST API version 2023-03-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-07-15-preview. Other available API versions: 2022-07-15-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native connectedvmwarevsphere [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or Update a Machine Extension (PUT)

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var machineExtension = new AzureNative.ConnectedVMwarevSphere.MachineExtension("machineExtension", new()
{
ExtensionName = "CustomScriptExtension",
Location = "eastus2euap",
Publisher = "Microsoft.Compute",
ResourceGroupName = "myResourceGroup",
Settings = new Dictionary<string, object?>
{
["commandToExecute"] = "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"",
},
Type = "CustomScriptExtension",
TypeHandlerVersion = "1.10",
VirtualMachineName = "myMachine",
});
});
package main
import (
connectedvmwarevsphere "github.com/pulumi/pulumi-azure-native-sdk/connectedvmwarevsphere/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := connectedvmwarevsphere.NewMachineExtension(ctx, "machineExtension", &connectedvmwarevsphere.MachineExtensionArgs{
ExtensionName: pulumi.String("CustomScriptExtension"),
Location: pulumi.String("eastus2euap"),
Publisher: pulumi.String("Microsoft.Compute"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Settings: pulumi.Any(map[string]interface{}{
"commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"",
}),
Type: pulumi.String("CustomScriptExtension"),
TypeHandlerVersion: pulumi.String("1.10"),
VirtualMachineName: pulumi.String("myMachine"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.connectedvmwarevsphere.MachineExtension;
import com.pulumi.azurenative.connectedvmwarevsphere.MachineExtensionArgs;
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 machineExtension = new MachineExtension("machineExtension", MachineExtensionArgs.builder()
.extensionName("CustomScriptExtension")
.location("eastus2euap")
.publisher("Microsoft.Compute")
.resourceGroupName("myResourceGroup")
.settings(Map.of("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\""))
.type("CustomScriptExtension")
.typeHandlerVersion("1.10")
.virtualMachineName("myMachine")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:connectedvmwarevsphere:MachineExtension CustomScriptExtension /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/extensions/{extensionName}

Constructors

Link copied to clipboard
constructor(autoUpgradeMinorVersion: Output<Boolean>? = null, enableAutomaticUpgrade: Output<Boolean>? = null, extensionName: Output<String>? = null, forceUpdateTag: Output<String>? = null, location: Output<String>? = null, protectedSettings: Output<Any>? = null, publisher: Output<String>? = null, resourceGroupName: Output<String>? = null, settings: Output<Any>? = null, tags: Output<Map<String, String>>? = null, type: Output<String>? = null, typeHandlerVersion: Output<String>? = null, virtualMachineName: Output<String>? = null)

Properties

Link copied to clipboard
val autoUpgradeMinorVersion: Output<Boolean>? = null

Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.

Link copied to clipboard
val enableAutomaticUpgrade: Output<Boolean>? = null

Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available.

Link copied to clipboard
val extensionName: Output<String>? = null

The name of the machine extension.

Link copied to clipboard
val forceUpdateTag: Output<String>? = null

How the extension handler should be forced to update even if the extension configuration has not changed.

Link copied to clipboard
val location: Output<String>? = null

Gets or sets the location.

Link copied to clipboard
val protectedSettings: Output<Any>? = null

The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.

Link copied to clipboard
val publisher: Output<String>? = null

The name of the extension handler publisher.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The Resource Group Name.

Link copied to clipboard
val settings: Output<Any>? = null

Json formatted public settings for the extension.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Gets or sets the Resource tags.

Link copied to clipboard
val type: Output<String>? = null

Specifies the type of the extension; an example is "CustomScriptExtension".

Link copied to clipboard
val typeHandlerVersion: Output<String>? = null

Specifies the version of the script handler.

Link copied to clipboard
val virtualMachineName: Output<String>? = null

The name of the machine where the extension should be created or updated.

Functions

Link copied to clipboard
open override fun toJava(): MachineExtensionArgs