IMHO, this is too much - the key here is that count.index
is being used compared to the initial post.
On the other hand I’m wondering about what you’re trying to do with the AZ tag finally as there are two resources (aws_vpc_endpoint and was_ec2_tag) managing the same tags.