Exclude_names Not Working as Expected in AWS

I had a working Vault Deployment using Terraform and AWS us-east-1e does not support my instance type of choice. I need to ensure it only uses the other 5 AZ’s. Below is what I added. Does anyone know what this is still not excluding me from us-east-1e???

Block I injected to ensure I do not use us-east-1e (does not support instance type)


data "aws_availability_zones" "available" {
  state = "available"

data "aws_availability_zones" "by_name" {
  exclude_names = ["us-east-1e"]

variable "region_number" {
default = {
us-east-1 = 1

variable "az_number" {
default = {
a = 1
b = 2
c = 3
d = 4
f = 5
e = 6

I was able to work around this and solve it. Wanted to post here to see share my progress. However, still curious how to make the exclude_names work as expected. Here is what I added to make it work…

data "aws_availability_zones" "a" {}
data "aws_availability_zones" "b" {}
data "aws_availability_zones" "c" {}
data "aws_availability_zones" "d" {}
data "aws_availability_zones" "f" {}

I understand this reached out to the api called back and either then allowed t he exclude or just used those zones and achieved the desired effect… Not sure.