VirtualMachineScaleSetExtension

class VirtualMachineScaleSetExtension : KotlinCustomResource

Manages an Extension for a Virtual Machine Scale Set.

NOTE: This resource is not intended to be used with the azure.compute.ScaleSet resource - instead it's intended for this to be used with the azure.compute.LinuxVirtualMachineScaleSet and azure.compute.WindowsVirtualMachineScaleSet resources.

Example Usage

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.compute.LinuxVirtualMachineScaleSet;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSetArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetOsDiskArgs;
import com.pulumi.azure.compute.VirtualMachineScaleSetExtension;
import com.pulumi.azure.compute.VirtualMachineScaleSetExtensionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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()
.location("West Europe")
.build());
var exampleLinuxVirtualMachineScaleSet = new LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", LinuxVirtualMachineScaleSetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.sku("Standard_F2")
.adminUsername("adminuser")
.instances(1)
.sourceImageReference(LinuxVirtualMachineScaleSetSourceImageReferenceArgs.builder()
.publisher("Canonical")
.offer("0001-com-ubuntu-server-focal")
.sku("20_04-lts")
.version("latest")
.build())
.networkInterfaces(LinuxVirtualMachineScaleSetNetworkInterfaceArgs.builder()
.name("example")
.ipConfigurations(LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs.builder()
.name("internal")
.build())
.build())
.osDisk(LinuxVirtualMachineScaleSetOsDiskArgs.builder()
.storageAccountType("Standard_LRS")
.caching("ReadWrite")
.build())
.build());
var exampleVirtualMachineScaleSetExtension = new VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", VirtualMachineScaleSetExtensionArgs.builder()
.virtualMachineScaleSetId(exampleLinuxVirtualMachineScaleSet.id())
.publisher("Microsoft.Azure.Extensions")
.type("CustomScript")
.typeHandlerVersion("2.0")
.settings(serializeJson(
jsonObject(
jsonProperty("commandToExecute", "echo $HOSTNAME")
)))
.build());
}
}

Import

Virtual Machine Scale Set Extensions can be imported using the resource id, e.g.

$ pulumi import azure:compute/virtualMachineScaleSetExtension:VirtualMachineScaleSetExtension test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachineScaleSets/scaleSet1/extensions/extension1

Properties

Link copied to clipboard

Should the Extension be automatically updated whenever the Publisher releases a new version of this VM Extension?

Link copied to clipboard

Should the latest version of the Extension be used at Deployment Time, if one is available? This won't auto-update the extension on existing installation. Defaults to true.

Link copied to clipboard

Should failures from the extension be suppressed? Possible values are true or false. Defaults to false.

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

A value which, when different to the previous value can be used to force-run the Extension even if the Extension Configuration hasn't changed.

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

The name for the Virtual Machine Scale Set Extension. Changing this forces a new resource to be created.

Link copied to clipboard

A JSON String which specifies Sensitive Settings (such as Passwords) for the Extension.

Link copied to clipboard

A protected_settings_from_key_vault block as defined below.

Link copied to clipboard

An ordered list of Extension names which this should be provisioned after.

Link copied to clipboard
val publisher: Output<String>

Specifies the Publisher of the Extension. Changing this forces a new resource to be created.

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

A JSON String which specifies Settings for the Extension.

Link copied to clipboard
val type: Output<String>

Specifies the Type of the Extension. Changing this forces a new resource to be created.

Link copied to clipboard

Specifies the version of the extension to use, available versions can be found using the Azure CLI.

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

The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created.