MachineExtension

class MachineExtension : KotlinCustomResource

Describes a Machine Extension. Uses Azure REST API version 2022-12-15-preview.

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.AzureStackHCI.MachineExtension("machineExtension", new()
{
ExtensionName = "CustomScriptExtension",
Location = "eastus2euap",
Name = "myMachine",
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",
});
});
package main
import (
azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azurestackhci.NewMachineExtension(ctx, "machineExtension", &azurestackhci.MachineExtensionArgs{
ExtensionName: pulumi.String("CustomScriptExtension"),
Location: pulumi.String("eastus2euap"),
Name: pulumi.String("myMachine"),
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"),
})
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.azurestackhci.MachineExtension;
import com.pulumi.azurenative.azurestackhci.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")
.name("myMachine")
.publisher("Microsoft.Compute")
.resourceGroupName("myResourceGroup")
.settings(Map.of("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\""))
.type("CustomScriptExtension")
.typeHandlerVersion("1.10")
.build());
}
}

Import

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

$ pulumi import azure-native:azurestackhci:MachineExtension CustomScriptExtension /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualMachines/{name}/extensions/{extensionName}

Properties

Link copied to clipboard

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 forceUpdateTag: Output<String>?

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The machine extension instance view.

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

The location.

Link copied to clipboard
val name: Output<String>

The name.

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

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

Link copied to clipboard

The provisioning state, which only appears in the response.

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

The name of the extension handler publisher.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val settings: Output<Any>?

Json formatted public settings for the extension.

Link copied to clipboard

The system data.

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

The Resource tags.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard

Specifies the version of the script handler.

Link copied to clipboard
val urn: Output<String>