alicloud_ecd_desktop

更新时间:
复制 MD 格式

Provides a ECD Desktop resource.

For information about ECD Desktop and how to use it, see What is Desktop

-> NOTE: Available since v1.144.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

resource "random_integer" "default" {
  min = 10000
  max = 99999
}

resource "alicloud_ecd_simple_office_site" "default" {
  cidr_block          = "172.16.0.0/12"
  enable_admin_access = true
  desktop_access_type = "Internet"
  office_site_name    = "${var.name}-${random_integer.default.result}"
}

resource "alicloud_ecd_policy_group" "default" {
  policy_group_name = var.name
  clipboard         = "read"
  local_drive       = "read"
  usb_redirect      = "off"
  watermark         = "off"

  authorize_access_policy_rules {
    description = var.name
    cidr_ip     = "1.2.3.45/24"
  }
  authorize_security_policy_rules {
    type        = "inflow"
    policy      = "accept"
    description = var.name
    port_range  = "80/80"
    ip_protocol = "TCP"
    priority    = "1"
    cidr_ip     = "1.2.3.4/24"
  }
}

data "alicloud_ecd_bundles" "default" {
  bundle_type = "SYSTEM"
}

resource "alicloud_ecd_desktop" "default" {
  office_site_id  = alicloud_ecd_simple_office_site.default.id
  policy_group_id = alicloud_ecd_policy_group.default.id
  bundle_id       = data.alicloud_ecd_bundles.default.bundles.1.id
  desktop_name    = var.name
}

Need more examples? VIEW MORE EXAMPLES

Argument Reference

The following arguments are supported:

  • amount - (Optional) The amount of the Desktop.

  • auto_pay - (Optional) The auto-pay of the Desktop whether to pay automatically. values: true, false.

  • auto_renew - (Optional) The auto-renewal of the Desktop whether to renew automatically. It takes effect only when the parameter ChargeType is set to PrePaid. values: true, false.

  • bundle_id - (Required) The bundle id of the Desktop.

  • desktop_name - (Optional) The desktop name of the Desktop.

  • desktop_type - (Optional) The desktop type of the Desktop.

  • office_site_id - (Required, ForceNew) The ID of the Simple Office Site.

  • end_user_ids - (Optional, ForceNew) The desktop end user id of the Desktop.

  • host_name - (Optional, Computed) The hostname of the Desktop. It takes effect only for Windows desktops in an AD office site. The value must be 2 to 15 characters and can contain letters, digits and hyphens (-); it cannot start or end with a hyphen, cannot contain consecutive hyphens, and cannot consist of digits only. For multiple desktops, the name_prefix[begin_number,bits]name_suffix format can be used to assign sequential hostnames. If it is not specified, the hostname assigned by the system is used.

    -> NOTE: The host name is set when the desktop is created and is not managed afterwards. Changing host_name neither recreates nor modifies the desktop, so the difference between the configuration and the actual host name is not reported.

  • desktop_timers - (Optional, Available in 2.2.0+) The list of scheduled timer tasks for the Desktop. Up to 20 timers can be configured. See desktop_timers below.

  • payment_type - (Optional, Computed) The payment type of the Desktop. Valid values: PayAsYouGo, Subscription. Default to PayAsYouGo.

  • period - (Optional) The period of the Desktop.

  • period_unit - (Optional) The period unit of the Desktop.

  • policy_group_id - (Required) The policy group id of the Desktop.

  • root_disk_size_gib - (Optional) The root disk size gib of the Desktop.

  • status - (Optional, Computed) The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

  • stopped_mode - (Optional) The stopped mode of the Desktop.

  • user_assign_mode - (Optional) The user assign mode of the Desktop. Valid values: ALL, PER_USER. Default to ALL.

  • user_disk_size_gib - (Optional) The user disk size gib of the Desktop.

  • tags - (Optional) A mapping of tags to assign to the resource.

desktop_timers

The desktop_timers supports the following:

  • timer_type - (Optional) The type of the scheduled timer task. Required when a desktop_timers block is configured. Valid values: LoginAutoConnect, LogoutShutdown, NoConnect, NoOperationDisconnect, NoOperationReboot, NoOperationShutdown, TimerBoot, TimerReboot, TimerReset, TimerShutdown.

  • cron_expression - (Optional) The cron expression of the scheduled timer task. The cron expression uses UTC time. For example, to execute at 00:00 Beijing time every day, set the value to 0 0 16 ? * 1,2,3,4,5,6,7.

  • interval - (Optional) The time interval, in minutes.

  • enforce - (Optional) Whether to force the execution of the scheduled timer task.

  • reset_type - (Optional) The reset type of the Desktop. Valid values: RESET_TYPE_BOTH, RESET_TYPE_SYSTEM.

  • allow_client_setting - (Optional) Whether to allow the end user to configure the scheduled timer task. Default to false.

  • operation_type - (Optional) The operation type of the scheduled timer task, only valid when timer_type is NoConnect. Valid values: Hibernate, Shutdown.

    -> NOTE: desktop_timers is a write-only field. Since the DescribeDesktops API does not return timer configurations, Terraform cannot detect drift on this field, and the field is ignored when importing. Removing the block stops Terraform from managing the timers: no update is sent, because ModifyDesktopTimer rejects a request that sets neither a timer type nor timer entries, so previously configured timers stay on the cloud desktop.

Attributes Reference

The following attributes are exported:

  • id - The resource ID in terraform of Desktop.

Timeouts

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

  • create - (Defaults to 10 mines) Used when create the Desktop.
  • delete - (Defaults to 10 mines) Used when delete the Desktop.
  • update - (Defaults to 20 mines) Used when update the Desktop.

Import

ECD Desktop can be imported using the id, e.g.

$ terraform import alicloud_ecd_desktop.example <id>