Index out of range got me

Accidently nuked half of some resources and broke DNS (yes, it is in fact always DNS). One of the first things I learned and is on a lot of guides for terraform is how count works. It’s one of the meta-arguments you can use with most resources, others are

1
2
3
4
5
depends_on 
count
for_each
provider / providers
lifecycle

Here’s an example for count before I show my oops.