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.82k stars 9.16k forks source link

[Bug]: Cannot set resize_option to `RESPONSIVE` in aws_quicksight_analysis #32344

Closed jshort-insights closed 1 year ago

jshort-insights commented 1 year ago

Terraform Core Version

1.4.5

AWS Provider Version

5.5.0

Affected Resource(s)

aws_quicksight_analysis

Expected Behavior

Setting the screen_canvas_size_options.resize_option as RESPONSIVE value should be applied to analysis sheet

Actual Behavior

Creating the analysis fails with an exception

The argument "optimized_view_port_width" is required, but no definition was found.

and alternatively when creating it optimized_view_port_width configured it returns

"OptimizedViewPortWidth must not be specified when ResizeOption is RESPONSIVE

Relevant Error/Panic Output Snippet

╷
│ Error: creating Amazon QuickSight Analysis (Example Analysis): InvalidParameterValueException: OptimizedViewPortWidth must not be specified when ResizeOption is RESPONSIVE.    
│   at Sheet example-sheet.
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "b3541572-b230-4870-bad0-c1e04f7183d3"
│   },
│   Message_: "OptimizedViewPortWidth must not be specified when ResizeOption is RESPONSIVE. \n\t at Sheet example-sheet.",
│   RequestId: "b3541572-b230-4870-bad0-c1e04f7183d3"
│ }
│

Terraform Configuration Files

resource "aws_quicksight_analysis" "example_download_analysis" {
  analysis_id    = "example-distribution-analysis"
  name           = "Example Analysis"
  aws_account_id = var.account_id

  definition {
    data_set_identifiers_declarations {
      data_set_arn = var.dataset_arn
      identifier   = var.dataset_id
    }

    sheets {
      sheet_id = "example-sheet"
      name     = "Example"

      visuals {
        pie_chart_visual {
          visual_id = "download-http-status-pie-chart"
          title {
            visibility = "VISIBLE"
            format_text {
              rich_text = "<visual-title>Download HTTP Statuses</visual-title>"
            }
          }
          subtitle {
            visibility = "VISIBLE"
          }
          chart_configuration {
            field_wells {
              pie_chart_aggregated_field_wells {
                category {
                  categorical_dimension_field {
                    field_id = "http-status-field"
                    column {
                      data_set_identifier = var.dataset_id
                      column_name         = "http_status"
                    }
                  }
                }
              }
            }
            donut_options {
              arc_options {
                arc_thickness = "MEDIUM"
              }
            }
            legend {
              width = "101px"
            }
            data_labels {
              visibility = "VISIBLE"
              overlap    = "DISABLE_OVERLAP"
            }
            tooltip {
              tooltip_visibility    = "VISIBLE"
              selected_tooltip_type = "DETAILED"
              field_base_tooltip {
                aggregation_visibility = "HIDDEN"
                tooltip_title_type     = "PRIMARY_VALUE"
                tooltip_fields {
                  field_tooltip_item {
                    field_id   = "http-status-field"
                    visibility = "VISIBLE"
                  }
                }
              }
            }
          }
        }
      }

      layouts {
        configuration {
          grid_layout {
            elements {
              element_id   = "download-http-status-pie-chart"
              element_type = "VISUAL"
              column_index = 0
              column_span  = 13
              row_index    = 0
              row_span     = 12
            }
            canvas_size_options {
              screen_canvas_size_options {
                resize_option             = "RESPONSIVE"
              }
            }
          }
        }
      }

      content_type = "INTERACTIVE"
    }

    analysis_defaults {
      default_new_sheet_configuration {
        interactive_layout_configuration {
          grid {
            canvas_size_options {
              screen_canvas_size_options {
                resize_option             = "FIXED"
                optimized_view_port_width = "1600px"
              }
            }
          }
        }
        sheet_content_type = "INTERACTIVE"
      }
    }
  }

  permissions {
    principal = var.quicksight_data_group
    actions = [
      "quicksight:DeleteAnalysis",
      "quicksight:DescribeAnalysis",
      "quicksight:DescribeAnalysisPermissions",
      "quicksight:QueryAnalysis",
      "quicksight:RestoreAnalysis",
      "quicksight:UpdateAnalysis",
      "quicksight:UpdateAnalysisPermissions",
    ]
  }
}

Steps to Reproduce

  1. Create analysis with a single chart element on the sheet
  2. Configure the sheets canvas with:
    canvas_size_options {
              screen_canvas_size_options {
                resize_option             = "RESPONSIVE"
              }
            }
  3. Create analysis

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

github-actions[bot] commented 1 year ago

This functionality has been released in v5.10.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.