Hello,
We’re currently encountering a problem with the implementation of TypeSet in the legacy SDK for Terraform, which mirrors the issue described in this forum post: TypeSet is not picking up correct changes - Terraform - HashiCorp Discuss
The crux of the issue is that when we run a terraform plan, we would prefer to see changes to elements in the TypeSet displayed rather than the addition or removal of elements. We recognize that this is more of a display issue, but it’s causing us significant frustration due to the high number of attributes in our data source.
We’re considering transitioning from the legacy Terraform SDK to the Terraform plugin framework, provided that the aforementioned issue can be resolved. Therefore, I have the following inquiries:
- Does the setType in the Terraform plugin framework support the modification of existing elements?
- Does the mapType in the Terraform plugin framework support complex objects as values? I believe this is the case based on my reading of the Terraform documentation, but I’d like confirmation.
- Does the mapType in the Terraform plugin framework maintain an unordered collection of elements?
- Assuming that mapType supports complex objects as values in the Terraform plugin framework, would a change in the object be expected in the plan, or would it be the same as the addition and removal in TypeSet?
For instance, if I were to alter the following:
resource "project" "foo" {
name = "a project"
role "owner1" {
description = "foo"
size = "xl"
}
role "owner2" {
description = "abc"
size = "xxx"
}
}
to this (note the change in the order of roles and the size for owner1):
resource "project" "foo" {
name = "a project"
role "owner1" {
description = "foo"
size = "xxl"
}
role "owner2" {
description = "abc"
size = "xxx"
}
}
Would the plan look like this?
~ resource "project" "foo" {
~role "owner1" {
description = "foo"
size = "xl" ~ "xxl"
}
}
Thank you for your assistance. Your insights will guide our decision-making process.