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.77k stars 9.12k forks source link

[Bug]: QuickSight aws_quicksight_data_set ignores refresh_properties #35041

Open vu-hoang-phan-form3 opened 9 months ago

vu-hoang-phan-form3 commented 9 months ago

Terraform Core Version

1.6.3

AWS Provider Version

5.30.0

Affected Resource(s)

aws_quicksight_data_set

Expected Behavior

When setting refresh_properties field, the data set's refresh properties are set on AWS.

Actual Behavior

Terraform plan and apply successfully without error, the state contains refresh_properties but on AWS the refresh properties are not set.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_quicksight_data_set" "data-set" {
  data_set_id = "my-data-set"
  name        = "my-data-set"
  import_mode = "SPICE"
  physical_table_map {
    physical_table_map_id = "my-table-map"

    custom_sql {
      data_source_arn = var.data_source_arn # this is an athena data source
      name            = "my-sql"
      sql_query       = "SELECT event_id, event_date FROM my_table"

      columns {
        name = "event_id"
        type = "STRING"
      }

      columns {
        name = "event_date"
        type = "DATETIME"
      }
    }
  }

  refresh_properties {
    refresh_configuration {
      incremental_refresh {
        lookback_window {
          column_name = "event_date"
          size        = 1
          size_unit   = "DAY"
        }
      }
    }
  }
}

Steps to Reproduce

  1. Create an Athena table from any source with event_id and event_date, insert some dummy data.
  2. Create QuickSight subscription, data source and data set:
resource "aws_quicksight_account_subscription" "subscription" {
  account_name          = "my-account"
  authentication_method = "IAM_AND_QUICKSIGHT"
  edition               = "ENTERPRISE"
  notification_email    = "john.doe@fakemail.com"
}

# QuickSight Data Source - Athena
resource "aws_quicksight_data_source" "data-source-athena" {
  data_source_id = "athena-data-source"
  name           = "Athena DataSource"
  type           = "ATHENA"

  parameters {
    athena {
      work_group = "primary"
  }
  ssl_properties {
    disable_ssl = false
  }
}

resource "aws_quicksight_data_set" "data-set" {
  data_set_id = "my-data-set"
  name        = "my-data-set"
  import_mode = "SPICE"
  physical_table_map {
    physical_table_map_id = "my-table-map"

    custom_sql {
      data_source_arn = aws_quicksight_data_source.data-source-athena.arn
      name            = "my-sql"
      sql_query       = "SELECT event_id, event_date FROM my_table"

      columns {
        name = "event_id"
        type = "STRING"
      }

      columns {
        name = "event_date"
        type = "DATETIME"
      }
    }
  }

  refresh_properties {
    refresh_configuration {
      incremental_refresh {
        lookback_window {
          column_name = "event_date"
          size        = 1
          size_unit   = "DAY"
        }
      }
    }
  }
}

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 9 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue