Terraform Version
% terraform --version
Terraform v1.14.1
+ provider registry.terraform.io/sumologic/sumologic v3.2.0
Affected Resource(s)
sumologic_role_v2
Terraform Configuration Files
resource "sumologic_role_v2" "example" {
name = "example_role"
selection_type = "Allow"
selected_views {
view_name = "index_a"
}
selected_views {
view_name = "index_b"
}
selected_views {
view_name = "index_c"
}
}
Debug Output
After a successful apply, an immediate re-plan shows changes:
~ selected_views {
~ view_name = "index_a" -> "index_b"
}
~ selected_views {
~ view_name = "index_b" -> "index_c"
}
~ selected_views {
~ view_name = "index_c" -> "index_a"
}
This repeats indefinitely — every plan shows selected_views reordering even though no actual change was made.
Expected Behavior
After a successful apply, a re-plan should show no changes when selected_views has not been modified.
Actual Behavior
The API returns selected_views in an arbitrary order that does not match the order sent during the apply. Because selected_views is defined as schema.TypeList (positional), Terraform interprets the reordering as a diff on every plan.
Root Cause
selected_views is defined as schema.TypeList which is order-sensitive. Since the Sumo Logic API does not guarantee the order of views in its response, the state read back after apply never matches the config order.
Terraform Version
Affected Resource(s)
sumologic_role_v2Terraform Configuration Files
Debug Output
After a successful apply, an immediate re-plan shows changes:
This repeats indefinitely — every plan shows
selected_viewsreordering even though no actual change was made.Expected Behavior
After a successful apply, a re-plan should show no changes when
selected_viewshas not been modified.Actual Behavior
The API returns
selected_viewsin an arbitrary order that does not match the order sent during the apply. Becauseselected_viewsis defined asschema.TypeList(positional), Terraform interprets the reordering as a diff on every plan.Root Cause
selected_viewsis defined as schema.TypeList which is order-sensitive. Since the Sumo Logic API does not guarantee the order of views in its response, the state read back after apply never matches the config order.