hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
258 stars 117 forks source link

[Bug]: Terraform doesn't send `themeArn` field in API call when creating or updating `aws_quicksight_analysis` #1220

Open atlesp opened 1 year ago

atlesp commented 1 year ago

Community Note

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform v1.4.6 on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

resource "aws_quicksight_analysis" "test" {
  analysis_id = "test"
  name        = "test"
  theme_arn   = "arn:aws:quicksight::aws:theme/MIDNIGHT"

  definition {
    data_set_identifiers_declarations {
      identifier   = aws_quicksight_data_set.test.name
      data_set_arn = aws_quicksight_data_set.test.arn
    }

    sheets {
      sheet_id     = "sheet-id1"
      description  = "Some description"
      name         = "Some Name"
      content_type = "INTERACTIVE"
      text_boxes {
        sheet_text_box_id = "textbox-id"

      }
      layouts {
        configuration {
          grid_layout {
            elements {
              column_index = 0
              column_span  = 36
              element_id   = "textbox-id"
              element_type = "TEXT_BOX"
              row_index    = 0
              row_span     = 3
            }
          }
        }
      }

    }

    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"
      }
    }
  }
}

Debug Output

Panic Output

None

Expected Behavior

When we set theme_arn for aws_quicksight_analysis we expect it to be forwarded to the API call to create/update the analysis and applied to the analysis in Quicksight.

Actual Behavior

Instead of forwarding it to the API call it seems to set it back to null, so it is always reset to the default classic theme on every deployment.

We have tried to set it both to arn:aws:quicksight::aws:theme/MIDNIGHT and created a new theme with aws_quicksight_theme and linked to that.

I checked the source code for the resource for create and update and they do not include the themeArn as they should based on the GO API docs

CreateAnalysisInput and Update

Steps to Reproduce

Set theme_arn for a aws_quicksight_analysis to any other value than the classic theme, for example arn:aws:quicksight::aws:theme/MIDNIGHT, and verify that it is not applied.

Based on the source code it seems like aws_quicksight_dashboard has the same bug

atlesp commented 1 year ago

Wrong repo, so closing it