alicloud_ecs_dedicated_host

This resouce used to create a dedicated host and store its initial version. For information about Aliecs Dedicated Host and how to use it, see What is Resource Aliecs Dedicated Host.

Example Usage

Basic Usage

resource "alicloud_ecs_dedicated_host" "default" {
  dedicated_host_type = "ddh.g6"
  tags = {
    Create = "Terraform",
    For    = "DDH",
  }
  description         = "From_Terraform"
  dedicated_host_name = "dedicated_host_name"
}

Create Prepaid DDH

resource "alicloud_ecs_dedicated_host" "example" {
  dedicated_host_type = "ddh.g5"
  tags = {
    Create = "Terraform",
    For    = "DDH",
  }
  description         = "terraform-example"
  dedicated_host_name = "terraform-example"
  payment_type        = "PrePaid"
  expired_time        = 1
  sale_cycle          = "Month"
}

Deleting alicloud_ecs_dedicated_host or removing it from your configuration

The alicloud_ecs_dedicated_host resource allows you to manage payment_type = "PrePaid" dedicated host, but Terraform cannot destroy it. Deleting the subscription resource or removing it from your configuration will remove it from your state file and management, but will not destroy the Dedicated Host. You can resume managing the subscription dedicated host via the AlibabaCloud Console.

Argument Reference

The following arguments are supported:

Attributes Reference

Timeouts

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

Import

Ecs dedicated host can be imported using the id, e.g.

$ terraform import alicloud_ecs_dedicated_host.default dh-2zedmxxxx