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

r/aws_quicksight: adjust definition.*.calculated_fields.*.expression max length to 32000 #33012

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changelog/33012.txt
Original file line number Diff line number Diff line change
@@ -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
```
14 changes: 1 addition & 13 deletions internal/service/quicksight/schema/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 1 addition & 13 deletions internal/service/quicksight/schema/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 17 additions & 13 deletions internal/service/quicksight/schema/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading