SpinTheMic
Pro

Interview practice question

Removing one item from a list recreates many resources

Cloud & DevOps · Terraform and IaC · Intermediate

You remove one user from a list used with count, and terraform plan wants to destroy and recreate several other users. Why, and how do you fix it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • count addresses by index; removal shifts indexes.
  • Items after removed one change address.
  • Switch to for_each with stable keys.
  • moved blocks to migrate addresses.
  • Plan should show only intended removal.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics