diff --git a/enos/enos-scenario-e2e-aws-base-with-vault.hcl b/enos/enos-scenario-e2e-aws-base-with-vault.hcl index 912efd68d2..a62eea8399 100644 --- a/enos/enos-scenario-e2e-aws-base-with-vault.hcl +++ b/enos/enos-scenario-e2e-aws-base-with-vault.hcl @@ -34,8 +34,9 @@ scenario "e2e_aws_base_with_vault" { variables { instance_type = [ + var.controller_instance_type, var.worker_instance_type, - var.controller_instance_type + var.target_instance_type ] } } diff --git a/enos/enos-scenario-e2e-aws-base.hcl b/enos/enos-scenario-e2e-aws-base.hcl index 67516508a5..8deaef9fe3 100644 --- a/enos/enos-scenario-e2e-aws-base.hcl +++ b/enos/enos-scenario-e2e-aws-base.hcl @@ -34,8 +34,9 @@ scenario "e2e_aws_base" { variables { instance_type = [ + var.controller_instance_type, var.worker_instance_type, - var.controller_instance_type + var.target_instance_type ] } } diff --git a/enos/enos-scenario-e2e-aws.hcl b/enos/enos-scenario-e2e-aws.hcl index 07b0140a5b..ebcf37c82e 100644 --- a/enos/enos-scenario-e2e-aws.hcl +++ b/enos/enos-scenario-e2e-aws.hcl @@ -39,8 +39,9 @@ scenario "e2e_aws" { variables { instance_type = [ + var.controller_instance_type, var.worker_instance_type, - var.controller_instance_type + var.target_instance_type ] } } diff --git a/enos/enos-scenario-e2e-database.hcl b/enos/enos-scenario-e2e-database.hcl index 1ed374bbc8..8c8bdbfbc2 100644 --- a/enos/enos-scenario-e2e-database.hcl +++ b/enos/enos-scenario-e2e-database.hcl @@ -36,8 +36,7 @@ scenario "e2e_database" { variables { instance_type = [ - var.worker_instance_type, - var.controller_instance_type + var.target_instance_type ] } } diff --git a/enos/enos-scenario-e2e-ui-aws.hcl b/enos/enos-scenario-e2e-ui-aws.hcl index 61c5238aa0..fce6762012 100644 --- a/enos/enos-scenario-e2e-ui-aws.hcl +++ b/enos/enos-scenario-e2e-ui-aws.hcl @@ -35,8 +35,9 @@ scenario "e2e_ui_aws" { variables { instance_type = [ + var.controller_instance_type, var.worker_instance_type, - var.controller_instance_type + var.target_instance_type ] } } diff --git a/enos/modules/aws_az_finder/main.tf b/enos/modules/aws_az_finder/main.tf index d46e579f21..8dbbe417d1 100644 --- a/enos/modules/aws_az_finder/main.tf +++ b/enos/modules/aws_az_finder/main.tf @@ -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" } +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 = data.aws_ec2_instance_type_offerings.infra.locations + value = local.common_azs }