You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 .t.tf
// no vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/10"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
shell>terraform apply
error: Error applying plan:
1 error occurred:
* output.first_vpc_id: Resource 'data.alicloud_vpcs.vpcs_ds' does not have attribute 'vpcs.0.id' for variable 'data.alicloud_vpcs.vpcs_ds.vpcs.0.id'
2.t.tf
// no vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/10"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
value = "${data.alicloud_vpcs.vpcs_ds.vpcs}"
#value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
shell>terraform apply
Outputs:
first_vpc_id = []
3.t.tf:
// existing vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/12"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
#value = "${data.alicloud_vpcs.vpcs_ds.vpcs}"
value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
Terraform v0.11.14
1 .t.tf
// no vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/10"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
shell>terraform apply
error: Error applying plan:
1 error occurred:
* output.first_vpc_id: Resource 'data.alicloud_vpcs.vpcs_ds' does not have attribute 'vpcs.0.id' for variable 'data.alicloud_vpcs.vpcs_ds.vpcs.0.id'
2.t.tf
// no vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/10"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
value = "${data.alicloud_vpcs.vpcs_ds.vpcs}"
#value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
shell>terraform apply
Outputs:
first_vpc_id = []
3.t.tf:
// existing vpc
data "alicloud_vpcs" "vpcs_ds" {
cidr_block = "172.16.0.0/12"
status = "Available"
name_regex = "^TF"
}
output "first_vpc_id" {
#value = "${data.alicloud_vpcs.vpcs_ds.vpcs}"
value = "${data.alicloud_vpcs.vpcs_ds.vpcs.0.id}"
}
shell>terraform apply
Outputs:
first_vpc_id = vpc-2ze2eeyclsybrka16d6jr
The text was updated successfully, but these errors were encountered: