Skip to content

azurermLabServiceSchedule

Manages a Lab Service Schedule.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermLabServiceLabExample = new azurerm.labServiceLab.LabServiceLab(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-lab",
    resource_group_name: azurermResourceGroupExample.name,
    security: [
      {
        open_access_enabled: false,
      },
    ],
    title: "Test Title",
    virtual_machine: [
      {
        admin_user: [
          {
            password: "Password1234!",
            username: "testadmin",
          },
        ],
        image_reference: [
          {
            offer: "0001-com-ubuntu-server-focal",
            publisher: "canonical",
            sku: "20_04-lts",
            version: "latest",
          },
        ],
        sku: [
          {
            capacity: 1,
            name: "Classic_Fsv2_2_4GB_128_S_SSD",
          },
        ],
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLabServiceLabExample.overrideLogicalId("example");
const azurermLabServiceScheduleExample =
  new azurerm.labServiceSchedule.LabServiceSchedule(this, "example_2", {
    lab_id: azurermLabServiceLabExample.id,
    name: "example-labschedule",
    stop_time: "2022-11-28T00:00:00Z",
    time_zone: "America/Los_Angeles",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLabServiceScheduleExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.

  • labId - (Required) The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.

  • stopTime - (Required) When Lab User Virtual Machines will be stopped in RFC-3339 format.

  • timeZone - (Required) The IANA Time Zone ID for the Schedule.

  • notes - (Optional) The notes for the Schedule.

  • recurrence - (Optional) A recurrence block as defined below.

  • startTime - (Optional) When Lab User Virtual Machines will be started in RFC-3339 format.


A recurrence block supports the following:

  • expirationDate - (Required) When the recurrence will expire in RFC-3339 format.

  • frequency - (Required) The frequency of the recurrence. Possible values are daily and weekly.

  • interval - (Optional) The interval to invoke the schedule on. Possible values are between 1 and 365.

  • weekDays - (Optional) The interval to invoke the schedule on. Possible values are sunday, monday, tuesday, wednesday, thursday, friday and saturday.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Lab Service Schedule.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Lab Service Schedule.
  • read - (Defaults to 5 minutes) Used when retrieving the Lab Service Schedule.
  • update - (Defaults to 30 minutes) Used when updating the Lab Service Schedule.
  • delete - (Defaults to 30 minutes) Used when deleting the Lab Service Schedule.

Import

Lab Service Schedules can be imported using the resourceId, e.g.

terraform import azurerm_lab_service_schedule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labs/lab1/schedules/schedule1