最近更新时间:2019-12-23 17:19:13
This data source provides a list of instance resources based on the availability zone and instance ID.
# Get instances
data "ksyun_instances" "default" {
output_file = "output_result"
ids = []
project_id = []
network_interface {
network_interface_id = []
subnet_id = []
group_id = []
}
instance_state {
name = []
}
availability_zone {
name = []
}
}
The following arguments are supported:
ids - (Optional) A list of instance IDs.name_regex - (Optional) A regex string to filter results by instance name.output_file - (Optional) The name of the file to store data source results output by executing terraform plan.In addition to all arguments above, the following attributes are exported:
instances - Instances documented below.This attribute (instances) supports the following:
instance_id - The ID of the instance.instance_state - The state of the instance.subnet_id - The ID of the subnet linked to the instance.image_id - The ID of the image to be uses by the instance.instance_type - The type of the instance.security_group_id - The ID of the associated security group.instance_name - The name of the instance.project_id - The ID of the project to which the instance is assigned.user_data - The user data to be specified into this instance.creation_date - Time of creation.charge_type - Instance charge type.availability_zone_name - The name of the availability zone where the instance is located.private_ip_address - Instance private IP address.disk_size - The size of the system disk.disk_type - The type of the system disk.纯净模式
