Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot set target_value for kpi_visual #31901

Closed
jshort-insights opened this issue Jun 12, 2023 · 3 comments · Fixed by #31902
Closed

[Bug]: Cannot set target_value for kpi_visual #31901

jshort-insights opened this issue Jun 12, 2023 · 3 comments · Fixed by #31902
Labels
bug Addresses a defect in current functionality. service/quicksight Issues and PRs that pertain to the quicksight service.
Milestone

Comments

@jshort-insights
Copy link

jshort-insights commented Jun 12, 2023

Terraform Core Version

1.4.5

AWS Provider Version

5.1.0

Affected Resource(s)

aws_quicksight_analysis

Expected Behavior

Defining a target_value should add necessary field to field well

Actual Behavior

Terraform apply runs successfully, but change is not replicated into AWS

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_quicksight_analysis" "generated_weekly_sales_analysis" {
  analysis_id    = "generated-weekly-sales-analysis"
  name           = "Old vs New Weekly sales Analysis"
  aws_account_id = data.aws_caller_identity.current.account_id

  definition {
    data_set_identifiers_declarations {
      data_set_arn = "arn:aws:quicksight:eu-west-1:370044283886:dataset/70d3ce75-c58d-4664-a1bc-495b483d9cb7"
      identifier   = "70d3ce75-c58d-4664-a1bc-495b483d9cb7"
    }

    sheets {
      sheet_id = "weekly-sales-sheet"
      name     = "Old V New Generated sales"

      visuals {
        kpi_visual {
          visual_id = "last-3-months-kpi"
          title {
            visibility = "VISIBLE"
            format_text {
              rich_text = "<visual-title>Difference Old  vs New sales (Last 3 Months)</visual-title>"
            }
          }
          subtitle {
            visibility = "VISIBLE"
          }
          chart_configuration {
            field_wells {
              values {
                numerical_measure_field {
                  field_id = "old-total-sales"
                  column {
                    data_set_identifier = "70d3ce75-c58d-4664-a1bc-495b483d9cb7"
                    column_name         = "Old Total sales"
                  }
                  aggregation_function {
                    simple_numerical_aggregation = "SUM"
                  }
                }
              }
              target_values {
                numerical_measure_field {
                  field_id = "new-total-sales"
                  column {
                    data_set_identifier = "70d3ce75-c58d-4664-a1bc-495b483d9cb7"
                    column_name         = "New Total sales"
                  }
                  aggregation_function {
                    simple_numerical_aggregation = "SUM"
                  }
                }
              }
            }
            sort_configuration {}

          }
        }
      }
      layouts {
        configuration {
          grid_layout {
            elements {
              element_id   = "last-3-months-kpi"
              element_type = "VISUAL"
              column_index = "0"
              column_span  = "32"
              row_index    = "12"
              row_span     = "4"
            }

            canvas_size_options {
              screen_canvas_size_options {
                resize_option             = "FIXED"
                optimized_view_port_width = "1600px"
              }
            }
          }
        }
      }
      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"
      }
    }
  }
}

Steps to Reproduce

aws quicksight describe-analysis-definition --aws-account-id <account_id> --analysis-id generated-weekly-sales-analysis


{
  "Status": 200,
  "AnalysisId": "generated-weekly-sales-analysis",
  "Name": "Old vs New Weekly sales Analysis",
  "ResourceStatus": "CREATION_SUCCESSFUL",
  "Definition": {
    "DataSetIdentifierDeclarations": [
      {
        "Identifier": "70d3ce75-c58d-4664-a1bc-495b483d9cb7",
        "DataSetArn": "arn:aws:quicksight:eu-west-1:12345678:dataset/70d3ce75-c58d-4664-a1bc-495b483d9cb7"
      }
    ],
    "Sheets": [
      {
        "SheetId": "weekly-sales-sheet",
        "Name": "Old V New Generated sales",
        "Visuals": [
          {
            "KPIVisual": {
              "VisualId": "last-3-months-kpi",
              "Title": {
                "Visibility": "VISIBLE",
                "FormatText": {
                  "RichText": "<visual-title>Difference Old  vs New sales (Last 3 Months)</visual-title>"
                }
              },
              "Subtitle": {
                "Visibility": "VISIBLE"
              },
              "ChartConfiguration": {
                "FieldWells": {
                  "Values": [
                    {
                      "NumericalMeasureField": {
                        "FieldId": "old-total-sales",
                        "Column": {
                          "DataSetIdentifier": "70d3ce75-c58d-4664-a1bc-495b483d9cb7",
                          "ColumnName": "Old Total Sales"
                        },
                        "AggregationFunction": {
                          "SimpleNumericalAggregation": "SUM"
                        }
                      }
                    }
                  ],
                  "TargetValues": [],
                  "TrendGroups": []
                },
                "SortConfiguration": {}
              },
              "Actions": [],
              "ColumnHierarchies": []
            }
          }
        ],
        "Layouts": [
          {
            "Configuration": {
              "GridLayout": {
                "Elements": [
                  {
                    "ElementId": "last-3-months-kpi",
                    "ElementType": "VISUAL",
                    "ColumnSpan": 32,
                    "RowIndex": 12,
                    "RowSpan": 4
                  }
                ],
                "CanvasSizeOptions": {
                  "ScreenCanvasSizeOptions": {
                    "ResizeOption": "FIXED",
                    "OptimizedViewPortWidth": "1600px"
                  }
                }
              }
            }
          }
        ],
        "ContentType": "INTERACTIVE"
      }
    ],
    "CalculatedFields": [],
    "ParameterDeclarations": [],
    "FilterGroups": [],
    "AnalysisDefaults": {
      "DefaultNewSheetConfiguration": {
        "InteractiveLayoutConfiguration": {
          "Grid": {
            "CanvasSizeOptions": {
              "ScreenCanvasSizeOptions": {
                "ResizeOption": "FIXED",
                "OptimizedViewPortWidth": "1600px"
              }
            }
          }
        },
        "SheetContentType": "INTERACTIVE"
      }
    }
  },
  "RequestId": "4a8f69de-c94b-4d29-b6dc-63de599d595a"
}


Note that TargetValues is an empty array although has been defined and applied in hcl

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@jshort-insights jshort-insights added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 12, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/quicksight Issues and PRs that pertain to the quicksight service. label Jun 12, 2023
g-dx added a commit to g-dx/terraform-provider-aws that referenced this issue Jun 12, 2023
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Jun 12, 2023
jar-b pushed a commit that referenced this issue Jun 12, 2023
@github-actions github-actions bot added this to the v5.3.0 milestone Jun 12, 2023
@github-actions
Copy link

This functionality has been released in v5.3.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
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/quicksight Issues and PRs that pertain to the quicksight service.
Projects
None yet
2 participants