Skip to content

Commit

Permalink
Refresh all QuickSight datasets (#1132)
Browse files Browse the repository at this point in the history
* refresh all the things

* order refresh by dependancies
  • Loading branch information
sastels authored Feb 8, 2024
1 parent 143f55c commit a954040
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 2 deletions.
15 changes: 15 additions & 0 deletions aws/quicksight/dataset_jobs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,18 @@ resource "aws_quicksight_data_set" "jobs" {
principal = aws_quicksight_group.dataset_owner.arn
}
}

resource "aws_quicksight_refresh_schedule" "jobs" {
data_set_id = "jobs"
schedule_id = "schedule-jobs"
depends_on = [aws_quicksight_data_set.jobs]

schedule {
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:15"
}
}
}
4 changes: 2 additions & 2 deletions aws/quicksight/dataset_login_events.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ resource "aws_quicksight_refresh_schedule" "login_events" {
depends_on = [aws_quicksight_data_set.login_events]

schedule {
refresh_type = "INCREMENTAL_REFRESH"
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:10"
time_of_the_day = "07:35"
}
}
}
16 changes: 16 additions & 0 deletions aws/quicksight/dataset_notifications.tf
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,19 @@ resource "aws_cloudformation_stack" "notifications" {
}
})
}


resource "aws_quicksight_refresh_schedule" "notifications" {
data_set_id = "notifications"
schedule_id = "schedule-notifications"
depends_on = [aws_cloudformation_stack.notifications]

schedule {
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:10"
}
}
}
16 changes: 16 additions & 0 deletions aws/quicksight/dataset_organisation.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,19 @@ resource "aws_quicksight_data_set" "organisation" {
principal = aws_quicksight_group.dataset_owner.arn
}
}


resource "aws_quicksight_refresh_schedule" "organisation" {
data_set_id = "organisation"
schedule_id = "schedule-organisation"
depends_on = [aws_quicksight_data_set.organisation]

schedule {
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:30"
}
}
}
17 changes: 17 additions & 0 deletions aws/quicksight/dataset_refresh_order.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Datasets are refreshed nightly. The order doesn't matter too much since we do it in the middle of the night, but we have ordered the refreshes by dependancy.
For example, we refresh the notifications before the services so we can be confident that if we have the notification in QuickSight then we have the corresponding service as well.

All times are UTC.

0510 - notification_history (takes about 1.5 hours. Rest of tables are under 5 minutes to refresh)
0710 - notifications

0715 - jobs
0720 - templates

0725 - services
0730 - organisations

0735 - login_events

15 changes: 15 additions & 0 deletions aws/quicksight/dataset_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,18 @@ resource "aws_quicksight_data_set" "services" {
principal = aws_quicksight_group.dataset_owner.arn
}
}

resource "aws_quicksight_refresh_schedule" "services" {
data_set_id = "services"
schedule_id = "schedule-services"
depends_on = [aws_quicksight_data_set.services]

schedule {
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:25"
}
}
}
15 changes: 15 additions & 0 deletions aws/quicksight/dataset_templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ resource "aws_quicksight_data_set" "templates" {
principal = aws_quicksight_group.dataset_owner.arn
}
}

resource "aws_quicksight_refresh_schedule" "templates" {
data_set_id = "templatesv2"
schedule_id = "schedule-templates"
depends_on = [aws_quicksight_data_set.templates]

schedule {
refresh_type = "FULL_REFRESH"

schedule_frequency {
interval = "DAILY"
time_of_the_day = "07:20"
}
}
}

0 comments on commit a954040

Please sign in to comment.