alicloud_slbs
更新時間:
-> DEPRECATED: This datasource has been renamed to alicloud_slb_load_balancers from version 1.123.1.
This data source provides the server load balancers of the current Alibaba Cloud user.
Example Usage
resource "alicloud_slb" "default" {
name = "sample_slb"
}
data "alicloud_slbs" "slbs_ds" {
name_regex = "sample_slb"
}
output "first_slb_id" {
value = data.alicloud_slbs.slbs_ds.slbs[0].id
}
Argument Reference
The following arguments are supported:
ids
- (Optional) A list of SLBs IDs.name_regex
- (Optional) A regex string to filter results by SLB name.master_availability_zone
- (Optional) Master availability zone of the SLBs.slave_availability_zone
- (Optional) Slave availability zone of the SLBs.network_type
- (Optional) Network type of the SLBs. Valid values:vpc
andclassic
.vpc_id
- (Optional) ID of the VPC linked to the SLBs.vswitch_id
- (Optional) ID of the vSwitch linked to the SLBs.address
- (Optional) Service address of the SLBs.tags
- (Optional) A map of tags assigned to the SLB instances. Thetags
can have a maximum of 5 tag. It must be in the format:data "alicloud_slbs" "taggedInstances" { tags = { tagKey1 = "tagValue1", tagKey2 = "tagValue2" } }
output_file
- (Optional) File name where to save data source results (after runningterraform plan
).resource_group_id
- (Optional, ForceNew, Available in 1.60.0+) The Id of resource group which SLB belongs.
Attributes Reference
The following attributes are exported in addition to the arguments listed above:
ids
- A list of slb IDs.names
- A list of slb names.slbs
- A list of SLBs. Each element contains the following attributes:id
- ID of the SLB.region_id
- Region ID the SLB belongs to.master_availability_zone
- Master availability zone of the SLBs.slave_availability_zone
- Slave availability zone of the SLBs.status
- SLB current status. Possible values:inactive
,active
andlocked
.name
- SLB name.network_type
- Network type of the SLB. Possible values:vpc
andclassic
.vpc_id
- ID of the VPC the SLB belongs to.vswitch_id
- ID of the vSwitch the SLB belongs to.address
- Service address of the SLB.internet
- SLB addressType: internet iftrue
, intranet iffalse
. Must befalse
whennetwork_type
isvpc
.creation_time
- SLB creation time.tags
- A map of tags assigned to the SLB instance.
文檔內容是否對您有幫助?