[Bug]: Order lost in aws_quicksight_analysis
causing endless plan updates due to ordering of calculated_fields
blocks
#32997
Labels
bug
Addresses a defect in current functionality.
prioritized
Part of the maintainer teams immediate focus. To be addressed within the current quarter.
service/quicksight
Issues and PRs that pertain to the quicksight service.
Milestone
Terraform Core Version
1.5.3
AWS Provider Version
5.9.0
Affected Resource(s)
The
calculated_fields
block inaws_quicksight_analysis
resourceExpected Behavior
When running multiple plans without changes to the Terraform configuration file, Terraform should detect no changes
Actual Behavior
When running multiple plans without changes to the Terraform configuration file, the outputs are updated on every plan due to reordering of the principals
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
terraform apply
terraform plan
Notice there's significance to the order of the
calculated_fields
blocks to recreate the issue.It seems that QuickSight API consistently returns the calculated fields in ascending alphanumeric order:
So, int he above Terraform configuration, I intentionally ordered them reversed, so the issue can be recreated
Debug Output
No response
Panic Output
No response
Important Factoids
Note 1
Looks like the
calculated_fields
field's Type should be changed fromTypeList
toTypeSet
(see here)Note 2
The workaround for this issue is to make sure the
calculated_fields
blocks in the Terraform configuration file are sorted in ascending alphanumeric order.This can be done by defining the calculated fields blocks in a list in
locals
and sort it bu name usingsort
function.Example:
Note 3
Since in QuickSight Analysis, the order of calculated fields isn't significant, the Terraform AWS Provider should ignore the order (although there's a workaround), and the user shouldn't be required to follow the QuickSight API order in the Terraform configuration file
References
There are similar GitHub issues in other QuickSight resources, such as #32645, #32991 and #32996
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: