chore(e2e): Fix availability zone check (#5935)

This commit is contained in:
Michael Li authored and GitHub committed 2025-07-17 16:30:27 -04:00
1 parent 05fe8f9511
commit 9778cb95f8
6 files changed
+18 -9

No files matched your search

+9 -3
View File
@@ -16,14 +16,20 @@ variable "instance_type" {
}
data "aws_ec2_instance_type_offerings" "infra" {
for_each = toset(var.instance_type)
filter {
name = "instance-type"
values = var.instance_type
values = [each.key]
}
location_type = "availability-zone"
}
output "availability_zones" {
value = data.aws_ec2_instance_type_offerings.infra.locations
locals {
az_sets = [for d in data.aws_ec2_instance_type_offerings.infra : toset(d.locations)]
common_azs = length(local.az_sets) > 0 ? setintersection(local.az_sets...) : []
}
output "availability_zones" {
value = local.common_azs
}