« Back to Index

Terraform: The problem with Terraform’s schema.TypeSet

View original Gist on GitHub

Tags: #terraform

The problem with Terraform’s schema.TypeSet.md

Set elements are viewed as opaque values that are added/removed.

If any elements “change”, then the set’s “identity” has changed.

The contents of the set is hashed, and so the changing of the content results in the set as a whole needing to be recreated.

This is why if you update a field inside a schema.TypeSet in Terraform, and you run a terraform plan you’ll see the entire resource marked as needing to be deleted and recreated.

Official GitHub discussion: https://github.com/hashicorp/terraform/pull/2336#issuecomment-115744243