diff --git a/.changelog/33012.txt b/.changelog/33012.txt new file mode 100644 index 00000000000..d0337acd5e1 --- /dev/null +++ b/.changelog/33012.txt @@ -0,0 +1,15 @@ +```release-note:bug +resource/aws_quicksight_analysis: Adjust max length of `definition.*.calculated_fields.*.expression` to 32000 characters +``` + +```release-note:bug +resource/aws_quicksight_dashboard: Adjust max length of `definition.*.calculated_fields.*.expression` to 32000 characters +``` + +```release-note:bug +resource/aws_quicksight_template: Adjust max length of `definition.*.calculated_fields.*.expression` to 32000 characters +``` + +```release-note:bug +resource/aws_quicksight_template: Adjust max items of `definition.*.calculated_fields` to 500 +``` diff --git a/internal/service/quicksight/schema/analysis.go b/internal/service/quicksight/schema/analysis.go index bd595763c3d..c7f53e1a167 100644 --- a/internal/service/quicksight/schema/analysis.go +++ b/internal/service/quicksight/schema/analysis.go @@ -25,19 +25,7 @@ func AnalysisDefinitionSchema() *schema.Schema { Schema: map[string]*schema.Schema{ "data_set_identifiers_declarations": dataSetIdentifierDeclarationsSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DataSetIdentifierDeclaration.html "analysis_defaults": analysisDefaultSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_AnalysisDefaults.html - "calculated_fields": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html - Type: schema.TypeList, - MinItems: 1, - MaxItems: 500, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data_set_identifier": stringSchema(true, validation.StringLenBetween(1, 2048)), - "expression": stringSchema(true, validation.StringLenBetween(1, 4096)), - "name": stringSchema(true, validation.StringLenBetween(1, 128)), - }, - }, - }, + "calculated_fields": calculatedFieldsSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html "column_configurations": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnConfiguration.html Type: schema.TypeList, MinItems: 1, diff --git a/internal/service/quicksight/schema/dashboard.go b/internal/service/quicksight/schema/dashboard.go index 5017c39efb2..d90845e53f2 100644 --- a/internal/service/quicksight/schema/dashboard.go +++ b/internal/service/quicksight/schema/dashboard.go @@ -25,19 +25,7 @@ func DashboardDefinitionSchema() *schema.Schema { Schema: map[string]*schema.Schema{ "data_set_identifiers_declarations": dataSetIdentifierDeclarationsSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DataSetIdentifierDeclaration.html "analysis_defaults": analysisDefaultSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_AnalysisDefaults.html - "calculated_fields": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html - Type: schema.TypeList, - MinItems: 1, - MaxItems: 500, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data_set_identifier": stringSchema(true, validation.StringLenBetween(1, 2048)), - "expression": stringSchema(true, validation.StringLenBetween(1, 4096)), - "name": stringSchema(true, validation.StringLenBetween(1, 128)), - }, - }, - }, + "calculated_fields": calculatedFieldsSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html "column_configurations": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnConfiguration.html Type: schema.TypeList, MinItems: 1, diff --git a/internal/service/quicksight/schema/template.go b/internal/service/quicksight/schema/template.go index 8f343b2b4a4..d7d9c738d97 100644 --- a/internal/service/quicksight/schema/template.go +++ b/internal/service/quicksight/schema/template.go @@ -27,19 +27,7 @@ func TemplateDefinitionSchema() *schema.Schema { Schema: map[string]*schema.Schema{ "data_set_configuration": dataSetConfigurationSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DataSetConfiguration.html "analysis_defaults": analysisDefaultSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_AnalysisDefaults.html - "calculated_fields": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html - Type: schema.TypeList, - MinItems: 1, - MaxItems: 100, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data_set_identifier": stringSchema(true, validation.StringLenBetween(1, 2048)), - "expression": stringSchema(true, validation.StringLenBetween(1, 4096)), - "name": stringSchema(true, validation.StringLenBetween(1, 128)), - }, - }, - }, + "calculated_fields": calculatedFieldsSchema(), // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html "column_configurations": { // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnConfiguration.html Type: schema.TypeList, MinItems: 1, @@ -177,6 +165,22 @@ func aggregationFunctionSchema(required bool) *schema.Schema { } } +func calculatedFieldsSchema() *schema.Schema { + return &schema.Schema{ // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CalculatedField.html + Type: schema.TypeList, + MinItems: 1, + MaxItems: 500, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "data_set_identifier": stringSchema(true, validation.StringLenBetween(1, 2048)), + "expression": stringSchema(true, validation.StringLenBetween(1, 32000)), + "name": stringSchema(true, validation.StringLenBetween(1, 128)), + }, + }, + } +} + func numericalAggregationFunctionSchema(required bool) *schema.Schema { return &schema.Schema{ // https://docs.aws.amazon.com/quicksight/latest/APIReference/API_NumericalAggregationFunction.html Type: schema.TypeList,