GlobalVMShutdownScheduleArgs

data class GlobalVMShutdownScheduleArgs(val dailyRecurrenceTime: Output<String>? = null, val enabled: Output<Boolean>? = null, val location: Output<String>? = null, val notificationSettings: Output<GlobalVMShutdownScheduleNotificationSettingsArgs>? = null, val tags: Output<Map<String, String>>? = null, val timezone: Output<String>? = null, val virtualMachineId: Output<String>? = null) : ConvertibleToJava<GlobalVMShutdownScheduleArgs>

Manages automated shutdown schedules for Azure VMs that are not within an Azure DevTest Lab. While this is part of the DevTest Labs service in Azure, this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the azure.devtest.Schedule resource

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.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.NetworkInterface;
import com.pulumi.azure.network.NetworkInterfaceArgs;
import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
import com.pulumi.azure.compute.LinuxVirtualMachine;
import com.pulumi.azure.compute.LinuxVirtualMachineArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
import com.pulumi.azure.devtest.GlobalVMShutdownSchedule;
import com.pulumi.azure.devtest.GlobalVMShutdownScheduleArgs;
import com.pulumi.azure.devtest.inputs.GlobalVMShutdownScheduleNotificationSettingsArgs;
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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.addressSpaces("10.0.0.0/16")
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.build());
var exampleNetworkInterface = new NetworkInterface("exampleNetworkInterface", NetworkInterfaceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
.name("testconfiguration1")
.subnetId(exampleSubnet.id())
.privateIpAddressAllocation("Dynamic")
.build())
.build());
var exampleLinuxVirtualMachine = new LinuxVirtualMachine("exampleLinuxVirtualMachine", LinuxVirtualMachineArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.networkInterfaceIds(exampleNetworkInterface.id())
.size("Standard_B2s")
.sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
.publisher("Canonical")
.offer("0001-com-ubuntu-server-focal")
.sku("20_04-lts")
.version("latest")
.build())
.osDisk(LinuxVirtualMachineOsDiskArgs.builder()
.name("myosdisk-example")
.caching("ReadWrite")
.storageAccountType("Standard_LRS")
.build())
.adminUsername("testadmin")
.adminPassword("Password1234!")
.disablePasswordAuthentication(false)
.build());
var exampleGlobalVMShutdownSchedule = new GlobalVMShutdownSchedule("exampleGlobalVMShutdownSchedule", GlobalVMShutdownScheduleArgs.builder()
.virtualMachineId(exampleLinuxVirtualMachine.id())
.location(exampleResourceGroup.location())
.enabled(true)
.dailyRecurrenceTime("1100")
.timezone("Pacific Standard Time")
.notificationSettings(GlobalVMShutdownScheduleNotificationSettingsArgs.builder()
.enabled(true)
.timeInMinutes("60")
.webhookUrl("https://sample-webhook-url.example.com")
.build())
.build());
}
}

Import

An existing Dev Test Global Shutdown Schedule can be imported using the resource id, e.g.

$ pulumi import azure:devtest/globalVMShutdownSchedule:GlobalVMShutdownSchedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-rg/providers/Microsoft.DevTestLab/schedules/shutdown-computevm-SampleVM

The name of the resource within the resource id will always follow the format shutdown-computevm-<VM Name> where <VM Name> is replaced by the name of the target Virtual Machine

Constructors

Link copied to clipboard
fun GlobalVMShutdownScheduleArgs(dailyRecurrenceTime: Output<String>? = null, enabled: Output<Boolean>? = null, location: Output<String>? = null, notificationSettings: Output<GlobalVMShutdownScheduleNotificationSettingsArgs>? = null, tags: Output<Map<String, String>>? = null, timezone: Output<String>? = null, virtualMachineId: Output<String>? = null)

Functions

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

Properties

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

The time each day when the schedule takes effect. Must match the format HHmm where HH is 00-23 and mm is 00-59 (e.g. 0930, 2300, etc.)

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

Whether to enable the schedule. Possible values are true and false. Defaults to true.

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

The location where the schedule is created. Changing this forces a new resource to be created.

Link copied to clipboard

The notification setting of a schedule. A notification_settings as defined below.

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

A mapping of tags to assign to the resource.

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

The time zone ID (e.g. Pacific Standard time). Refer to this guide for a full list of accepted time zone names.

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

The resource ID of the target ARM-based Virtual Machine. Changing this forces a new resource to be created.