hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.71k stars 9.07k forks source link

[Bug]: QuickSight Dataset error with ColumnGeographicRole not existing #38326

Open tb102122 opened 1 month ago

tb102122 commented 1 month ago

Terraform Core Version

1.8.5

AWS Provider Version

5.57.0

Affected Resource(s)

When running the mu terraform code I get the below error message:

creating QuickSight Data Set: ValidationException: 1 validation error detected: Value '' at 'logicalTableMap.XXX.member.dataTransforms.5.member.tagColumnOperation.tags.1.member.columnGeographicRole' failed to satisfy constraint: Member must satisfy enum value set: [COUNTY, CITY, LATITUDE, POSTCODE, LONGITUDE, STATE, CENSUS_BLOCK, CENSUS_BLOCK_GROUP, POLITICAL1, COUNTRY, CENSUS_TRACT]

the actual code element looks like the following

data_transforms {  
  tag_column_operation {  
    column_name = "VEHICLE_HAS_INCIDENT"  
    tags {  
      column_description {  
        text = "Indicates if checked vehicle has an indecent (missing, damages, ...)"  
      }  
    }  
  }  
}  
....

Expected Behavior

create dataset successful. I am new to go but I assume that the reason is the missing evaluation for an empty string in that section. https://github.com/hashicorp/terraform-provider-aws/blob/b82f0e1e9050dfb9052e8549e40551eaa0788e4d/internal/service/quicksight/data_set.go#L1617

Actual Behavior

failed to create dataset

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "random_uuid" "data_set_xxx-" {}

resource "aws_quicksight_data_set" "xxx" {
  data_set_id = random_uuid.data_set_xxx.result
  name        = "xxx"
  import_mode = "SPICE"
  tags        = var.tags

  physical_table_map {
    physical_table_map_id = "92c95af3-915b-4d03-a977-1e6e8f7e06b8"

    custom_sql {
      data_source_arn = XXX
      name            = "VEHICLES"
      sql_query       = "XXX"

      columns {
        name = "AUDIT_ID"
        type = "STRING"
      }
      columns {
        name = "DIVISION"
        type = "STRING"
      }
    }
  }
  data_set_usage_configuration {
    disable_use_as_direct_query_source = false
    disable_use_as_imported_source     = false
  }

  logical_table_map {
    logical_table_map_id = "16b4dda8-18d9-48f6-b8c9-ee2ef62908b6"
    alias                = "Intermediate Table"
    data_transforms {
      tag_column_operation {
        column_name = "VEHICLE_HAS_INCIDENT"
        tags {
          column_description {
            text = "Indicates if checked vehicle has an indecent (missing, damages...)"
          }
          column_geographic_role = null
        }
      }
    }
  }
}

Steps to Reproduce

run dataset create with tags but without a value for column_geographic_role even forcing the value to null results in the same error.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue