Skip to content

quicksight_analysis custom_values_configuration sends empty value lists even when not defined #43120

@estein9825

Description

@estein9825

Terraform and AWS Provider Version

### Terraform Version


Terraform v1.8.x
AWS Provider v5.100+

Affected Resource(s) or Data Source(s)

  • aws_quicksight_analysis
  • specifically under:
    visual > actions > action_operations > set_parameters_operation > value > custom_values_configuration > custom_values

Expected Behavior

custom_values_configuration {
custom_values {
string_values = ["NULL"]
}
}

Which should result a JSON of

"SetParametersOperation": {
  "ParameterValueConfigurations": [
       {
           ...
           "Value": {
                "CustomValuesConfiguration": {
                      "CustomValues": {
                           "StringValues": [
                                  "NULL"
                            ]
                       }
                       "IncludeNullValue": false
                }
           }
       }
  ]
}

Actual Behavior

Generates:

"SetParametersOperation": {
  "ParameterValueConfigurations": [
       {
           ...
           "Value": {
                "CustomValuesConfiguration": {
                      "CustomValues": {
                           "DateTimeValues": [],
                           "DecimalValues": [],
                           "IntegerValues": [],
                           "StringValues": [
                                  "NULL"
                            ]
                       }
                       "IncludeNullValue": false
                }
           }
       }
  ]
}

This causes the QuickSight API to reject the request with an error like:

ValidationException: CustomValuesConfiguration must specify only a subset of [StringValues, IntegerValues, DecimalValues, DateTimeValues].

This behavior makes it impossible to use navigation or parameter actions with a single value type via Terraform.

Relevant Error/Panic Output

ValidationException: CustomValuesConfiguration must specify only a subset of [StringValues, IntegerValues, DecimalValues, DateTimeValues].

Sample Terraform Configuration

Click to expand configuration

Steps to Reproduce

Steps to Reproduce

  1. Create a QuickSight analysis with a visual (e.g., table or chart)
  2. Add a visual action like this:
actions {
  ...
  action_operations {
    set_parameters_operation {
      parameter_value_configurations {
        destination_parameter_name = "MyParam"
        value {
          custom_values_configuration {
            custom_values {
              string_values = ["NULL"]
            }
          }
        }
      }
    }
  }
}

  1. Run terraform apply
  2. Observe the API request (e.g., via TF_LOG=debug) and the QuickSight error

Debug Logging

apply_debug.txt

GenAI / LLM Assisted Development

n/a

Important Facts and References

Looking at visual_actions.go, the schema is defined as:

"string_values": {
  Type:     schema.TypeList,
  Optional: true,
  Elem: &schema.Schema{Type: schema.TypeString},
},
"decimal_values": { ... },
"integer_values": { ... },
"date_time_values": { ... },

The flatten and expand logic appears to include the other fields regardless of whether they were set in the HCL, likely due to how empty lists are handled during serialization.

Suggested Fix
The provider should:

  • Check for len(list) > 0 before including the list in the request payload
  • Omit unset or empty value types from CustomValues when building the request model
  • Align behavior with other AWS Terraform resources that skip optional empty fields

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/quicksightIssues and PRs that pertain to the quicksight service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions