Using a terraform dynamic block in the aws_quicksight_refresh_schedule resource for refresh_on_day is throwing a value conversion error
An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer:
│
│ Received unknown value, however the target type cannot handle unknown values. Use the corresponding `types` package type or a custom type that handles unknown values.
│
│ Path:
│ Target Type: []quicksight.refreshOnDayData
│ Suggested Type: basetypes.ListValue
my code –
schedule {
refresh_type = each.value.refresh.type
schedule_frequency {
interval = each.value.refresh.interval
time_of_the_day = each.value.refresh.time_of_day
timezone = each.value.refresh.timezone
dynamic "refresh_on_day" {
for_each = each.value.refresh.interval == "WEEKLY" || each.value.refresh.interval == "MONTHLY" ? [1] : []
content {
day_of_week = try(each.value.refresh.interval == "WEEKLY" ? each.value.refresh.refresh_on_day : null, null)
day_of_month = try(each.value.refresh.interval == "MONTHLY" ? each.value.refresh.refresh_on_day : null, null)
}
}
}
}
My for_each variable looks like –
analytic-tables = {
"analytic-output" : {
description = "Description 1"
location = "folder/output-1/"
refresh = {
column_name = "date"
window_size = "1"
window_size_unit = "DAY"
type = "INCREMENTAL_REFRESH"
interval = "DAILY"
time_of_day = "02:00"
timezone = "America/New_York"
refresh_on_day = ""
}
columns = [
{
name = "date"
type = "datetime"
},
{
name = "run_date"
type = "datetime"
}
]
},
"runids" : {
description = "Description 2"
location = "folder/output-2"
refresh = {
type = "FULL_REFRESH"
interval = "WEEKLY"
time_of_day = "02:00"
timezone = "America/New_York"
refresh_on_day = "Monday"
}
columns = [
{
name = "site"
type = "string"
},
{
name = "birth_year"
type = "bigint"
qtype = "integer"
}
]
}
}
Any help would be greatly appreciated.
Thank you