hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

[Bug]: AWS QuickSight Aggregation Function #33580

Open ThulaniJr7 opened 1 year ago

ThulaniJr7 commented 1 year ago

Terraform Core Version

1.5.3

AWS Provider Version

5.16.1

Affected Resource(s)

No response

Expected Behavior

If you comment out the attribute, we will be able to run “terraform plan” followed by “terraform apply”.

aggregation {
                      ############ This is missing in TF and we need to disable the entire tooltip
#                      attribute_aggregation_function {
#                        simple_attribute_aggregation = "UNIQUE_VALUE"
#                      }
                    }

When you run “terraform apply” and the command executes completely, the dashboard will be created on Quicksight. The problem that we’re facing is that the geospatial map visual doesn’t display as it should because you need to comment out the function before it can be displayed.

Actual Behavior

When we run the “terraform plan”, the code below fails because it will throw out an Unsupported block type error. This is due to the aggregation function with the “attribute_aggregation_function” attribute. I noticed that the main problem is that the aggregation function used for the POI ID tooltip, the “UNIQUE_VALUES” aggregation function does not seem to be part of the terraform adapter, but it is in AWS API.

sheets {
  content_type = "INTERACTIVE"
  description  = null
  name         = "Location"
  sheet_id     = "ac8631b0-654f-4d43-b7ed-###"
  title        = null
  layouts {
    configuration {
      grid_layout {
        canvas_size_options {
          screen_canvas_size_options {
            optimized_view_port_width = "1600px"
            resize_option             = "FIXED"
          }
        }
        elements {
          column_index = 0
          column_span  = 18
          element_id   = "bedc01ec-feb6-4acd-8ed2-###"
          element_type = "VISUAL"
          row_index    = 0
          row_span     = 12
        }
      }
    }
  }
  visuals {
    geospatial_map_visual {
      visual_id = "bedc01ec-feb6-4acd-8ed2-###"
      chart_configuration {
        field_wells {
          geospatial_map_aggregated_field_wells {
            geospatial {
              numerical_dimension_field {
                field_id     = "LogicalTableKeyName.longitude.###"
                hierarchy_id = null
                column {
                  column_name         = "###"
                  data_set_identifier = "E2E: ###"
                }
              }
            }
            geospatial {
              numerical_dimension_field {
                field_id     = "LogicalTableKeyName.latitude.###"
                hierarchy_id = null
                column {
                  column_name         = "###"
                  data_set_identifier = "E2E: ###"
                }
              }
            }
            colors {
              categorical_dimension_field {
                field_id = "LogicalTableKeyName.feedback_id.###"
                column {
                  column_name         = "###"
                  data_set_identifier = "E2E: ###"
                }
              }
            }
          }
        }
        map_style_options {
          base_map_style = "LIGHT_GRAY"
        }
        tooltip {
          selected_tooltip_type = "DETAILED"
          tooltip_visibility    = "VISIBLE"
          field_base_tooltip {
            aggregation_visibility = "HIDDEN"
            tooltip_title_type     = "PRIMARY_VALUE"
            tooltip_fields {
              **column_tooltip_item {
                visibility = "VISIBLE"
                label      = "###"
                aggregation {
                  ############ This is missing in TF and we need to disable the entire tooltip
                  attribute_aggregation_function {
                    simple_attribute_aggregation = "UNIQUE_VALUE"
                  }
                }
                column {
                  column_name         = "###"
                  data_set_identifier = "E2E: ###"
                }
              }**
            }
          }
        }
        window_options {
          map_zoom_mode = "MANUAL"
          #              bounds {
          #                east  = -1799
          #                north = 89
          #                south = -89
          #                west  = 1799
          #              }
        }
      }
      subtitle {
        visibility = "VISIBLE"
      }
      title {
        visibility = "VISIBLE"
      }
    }
  }
}

The error received after running “terraform plan” is displayed below:

**Error: Unsupported block type
on dashboard_bug.tf line 170, in resource "aws_quicksight_dashboard" "feedback-dashboard-bug":
170:                       attribute_aggregation_function {
 Blocks of type "attribute_aggregation_function" are not expected here.**

Relevant Error/Panic Output Snippet

No response

Terraform Configuration File

    sheets {
      content_type = "INTERACTIVE"
      description  = null
      name         = "Location"
      sheet_id     = "ac8631b0-654f-4d43-b7ed-###"
      title        = null
      layouts {
        configuration {
          grid_layout {
            canvas_size_options {
              screen_canvas_size_options {
                optimized_view_port_width = "1600px"
                resize_option             = "FIXED"
              }
            }
            elements {
              column_index = 0
              column_span  = 18
              element_id   = "bedc01ec-feb6-4acd-8ed2-###"
              element_type = "VISUAL"
              row_index    = 0
              row_span     = 12
            }
          }
        }
      }
      visuals {
        geospatial_map_visual {
          visual_id = "bedc01ec-feb6-4acd-8ed2-###"
          chart_configuration {
            field_wells {
              geospatial_map_aggregated_field_wells {
                geospatial {
                  numerical_dimension_field {
                    field_id     = "LogicalTableKeyName.longitude.###"
                    hierarchy_id = null
                    column {
                      column_name         = "###"
                      data_set_identifier = "E2E: ###"
                    }
                  }
                }
                geospatial {
                  numerical_dimension_field {
                    field_id     = "LogicalTableKeyName.latitude.###"
                    hierarchy_id = null
                    column {
                      column_name         = "###"
                      data_set_identifier = "E2E: ###"
                    }
                  }
                }
                colors {
                  categorical_dimension_field {
                    field_id = "LogicalTableKeyName.feedback_id.###"
                    column {
                      column_name         = "###"
                      data_set_identifier = "E2E: ###"
                    }
                  }
                }
              }
            }
            map_style_options {
              base_map_style = "LIGHT_GRAY"
            }
            tooltip {
              selected_tooltip_type = "DETAILED"
              tooltip_visibility    = "VISIBLE"
              field_base_tooltip {
                aggregation_visibility = "HIDDEN"
                tooltip_title_type     = "PRIMARY_VALUE"
                tooltip_fields {
                  column_tooltip_item {
                    visibility = "VISIBLE"
                    label      = "Provider POI ID"
                    aggregation {
                      ############ This is missing in TF and we need to disable the entire tooltip
#                      attribute_aggregation_function {
#                        simple_attribute_aggregation = "UNIQUE_VALUE"
#                      }
                    }
                    column {
                      column_name         = "provider_poi_id"
                      data_set_identifier = "E2E: ###"
                    }
                  }
                }
              }
            }
            window_options {
              map_zoom_mode = "MANUAL"
              #              bounds {
              #                east  = -1799
              #                north = 89
              #                south = -89
              #                west  = 1799
              #              }
            }
          }
          subtitle {
            visibility = "VISIBLE"
          }
          title {
            visibility = "VISIBLE"
          }
        }
      }
    }
  }

Steps to Reproduce

terraform make terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue