Skip to content

Commit

Permalink
Added quicksight sms usage dataset with fixed date data type as string (
Browse files Browse the repository at this point in the history
#1201)

* Revert "Quicksight: Added SMS usage report as a data set (#1193)"

This reverts commit f4dbd4d.

* Added quicksight sms usage dataset with fixed date data type as string

* Converted all remaining columns that were not STRING to STRING.
  • Loading branch information
jimleroyer authored Mar 14, 2024
1 parent e16e1a3 commit 092107d
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions aws/quicksight/dataset_sms_usage.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# valid column types are [STRING INTEGER DECIMAL DATETIME BIT BOOLEAN JSON]

resource "aws_quicksight_data_set" "sms_usage" {
data_set_id = "sms_usage"
name = "SmsUsage"
import_mode = "SPICE"

physical_table_map {
physical_table_map_id = "smsusage"

s3_source {
data_source_arn = aws_quicksight_data_source.s3_sms_usage.arn

upload_settings {
contains_header = "true"
delimiter = ","
format = "CSV"
}

input_columns {
name = "PublishTimeUTC"
type = "STRING"
}
input_columns {
name = "MessageId"
type = "STRING"
}
input_columns {
name = "MessageType"
type = "STRING"
}
input_columns {
name = "DeliveryStatus"
type = "STRING"
}
input_columns {
name = "PriceInUSD"
type = "STRING"
}
input_columns {
name = "PartNumber"
type = "STRING"
}
input_columns {
name = "TotalParts"
type = "STRING"
}
}
}

permissions {
actions = local.dataset_viewer_permissions
principal = aws_quicksight_group.dataset_viewer.arn
}
permissions {
actions = local.dataset_owner_permissions
principal = aws_quicksight_group.dataset_owner.arn
}
}

resource "aws_quicksight_refresh_schedule" "sms_usage" {
data_set_id = "sms_usage"
schedule_id = "schedule-sms-usage"
depends_on = [aws_quicksight_data_set.sms_usage]

schedule {
refresh_type = "INCREMENTAL_REFRESH"

# SMS usage reports are generated around 01:00 UTC.
schedule_frequency {
interval = "DAILY"
time_of_the_day = "02:30"
}
}
}

0 comments on commit 092107d

Please sign in to comment.