» alicloud_ons_instances

This data source provides a list of ONS Instances in an Alibaba Cloud account according to the specified filters.

» Example Usage

variable "name" {
  default = "onsInstanceDatasourceName"
}

resource "alicloud_ons_instance" "default" {
  name   = "${var.name}"
  remark = "default_ons_instance_remark"
}

data "alicloud_ons_instances" "instances_ds" {
  ids         = ["${alicloud_ons_instance.default.id}"]
  name_regex  = "${alicloud_ons_instance.default.name}"
  output_file = "instances.txt"
}

output "first_instance_id" {
  value = "${data.alicloud_ons_instances.instances_ds.instances.0.instance_id}"
}

» Argument Reference

The following arguments are supported:

  • ids - (Optional) A list of instance IDs to filter results.
  • name_regex - (Optional) A regex string to filter results by the instance name.
  • output_file - (Optional) File name where to save data source results (after running terraform plan).

» Attributes Reference

The following attributes are exported in addition to the arguments listed above: