alicloud_simple_application_server_custom_image
更新时间:
Provides a Simple Application Server Custom Image resource.
For information about Simple Application Server Custom Image and how to use it, see What is Custom Image.
-> NOTE: Available since v1.143.0.
Example Usage
Basic Usage
variable "name" {
  default = "tf_example"
}
data "alicloud_simple_application_server_images" "default" {}
data "alicloud_simple_application_server_plans" "default" {}
resource "alicloud_simple_application_server_instance" "default" {
  payment_type   = "Subscription"
  plan_id        = data.alicloud_simple_application_server_plans.default.plans.0.id
  instance_name  = var.name
  image_id       = data.alicloud_simple_application_server_images.default.images.0.id
  period         = 1
  data_disk_size = 100
}
data "alicloud_simple_application_server_disks" "default" {
  instance_id = alicloud_simple_application_server_instance.default.id
}
resource "alicloud_simple_application_server_snapshot" "default" {
  disk_id       = data.alicloud_simple_application_server_disks.default.ids.0
  snapshot_name = var.name
}
resource "alicloud_simple_application_server_custom_image" "default" {
  custom_image_name  = var.name
  instance_id        = alicloud_simple_application_server_instance.default.id
  system_snapshot_id = alicloud_simple_application_server_snapshot.default.id
  status             = "Share"
  description        = var.name
}
Argument Reference
The following arguments are supported:
custom_image_name- (Required, ForceNew) The name of the resource. The name must be2to128characters in length. It must start with a letter or a number. It can contain letters, digits, colons (:), underscores (_) and hyphens (-).description- (Optional, ForceNew) The description of the Custom Image.instance_id- (Required) The ID of the instance.system_snapshot_id- (Required) The ID of the system snapshot.status- (Optional) The Shared status of the Custom Image. Valid values:Share,UnShare.
NOTE: The status will be automatically change to UnShare when the resource is deleted, please operate with caution.
Attributes Reference
The following attributes are exported:
id- The resource ID in terraform of Custom Image.
Import
Simple Application Server Custom Image can be imported using the id, e.g.
$ terraform import alicloud_simple_application_server_custom_image.example <id>
该文章对您有帮助吗?