The Instances data source list ECS instance resource accoring to its ID, name regex, image id, status and other fields.

Example Usage

data "alicloud_instances" "instances" {
    name_regex = "web_server"
    status = "Running"

Argument Reference

The following arguments are supported:

  • ids - (Optional) A list of ECS instance ID.
  • name_regex - (Optional) A regex string to apply to the instance list returned by Alicloud.
  • image_id - (Optional) The image ID of some ECS instance used.
  • status - (Optional) List specified status instances. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". Default to list all status.
  • vpc_id - (Optional) List several instances in the specified VPC.
  • vswitch_id - (Optional) List several instances in the specified VSwitch.
  • availability_zone - (Optional) List several instances in the specified availability zone.
  • tags - (Optional) A mapping of tags marked ECS instanes.
  • output_file - (Optional) The name of file that can save instances data source after running terraform plan.

Attributes Reference

The following argument are exported:

  • instances A list of instnaces. It contains several attributes to Block Instances.

Block Instances

Attributes for instanes:

© 2018 HashiCorpLicensed under the MPL 2.0 License.