Skip to content

Commit

Permalink
r/aws_quicksight: adjust definition.*.calculated_fields.*.expression …
Browse files Browse the repository at this point in the history
…max length to 32000 (#33012)

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

* chore: changelog
  • Loading branch information
jar-b committed Aug 15, 2023
1 parent 7e2fd6f commit b0ce457
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
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

0 comments on commit b0ce457

Please sign in to comment.