diff --git a/infrastructure/terraform/components/reporting/data_iam_policy_document_sso_read_only_table_access.tf b/infrastructure/terraform/components/reporting/data_iam_policy_document_sso_read_only_table_access.tf index c3552b7f..6aa21525 100644 --- a/infrastructure/terraform/components/reporting/data_iam_policy_document_sso_read_only_table_access.tf +++ b/infrastructure/terraform/components/reporting/data_iam_policy_document_sso_read_only_table_access.tf @@ -33,7 +33,8 @@ data "aws_iam_policy_document" "sso_read_only_table_access" { "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/request_item_status_summary_all", "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/request_item_status_summary_all_email_filter", "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/dates", - "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/letters_invoice_units", + "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/letters_invoice_units_monthly", + "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/letters_invoice_units_weekly", "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/latency_percentiles", "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/daily_recipient_count", "arn:aws:glue:${var.region}:${var.aws_account_id}:table/${var.project}-*-reporting-database/daily_recipient_distribution", diff --git a/infrastructure/terraform/components/reporting/iam_instance_profile_powerbi_gateway.tf b/infrastructure/terraform/components/reporting/iam_instance_profile_powerbi_gateway.tf index deb3f7bd..b777ea45 100644 --- a/infrastructure/terraform/components/reporting/iam_instance_profile_powerbi_gateway.tf +++ b/infrastructure/terraform/components/reporting/iam_instance_profile_powerbi_gateway.tf @@ -185,7 +185,8 @@ data "aws_iam_policy_document" "powerbi_gateway_permissions_policy" { "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/request_item_status_summary_all", "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/request_item_status_summary_all_email_filter", "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/dates", - "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/letters_invoice_units", + "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/letters_invoice_units_monthly", + "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/letters_invoice_units_weekly", "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/latency_percentiles", "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/daily_recipient_count", "arn:aws:glue:${var.region}:${local.this_account}:table/${aws_glue_catalog_database.reporting.name}/daily_recipient_distribution", diff --git a/infrastructure/terraform/components/reporting/null_resource_letters_invoice_units_monthly_view.tf b/infrastructure/terraform/components/reporting/null_resource_letters_invoice_units_monthly_view.tf new file mode 100644 index 00000000..97e3b969 --- /dev/null +++ b/infrastructure/terraform/components/reporting/null_resource_letters_invoice_units_monthly_view.tf @@ -0,0 +1,17 @@ +resource "null_resource" "letters_invoice_units_monthly_view" { + triggers = { + sql = filesha256("${path.module}/scripts/sql/views/letters_invoice_units_monthly.sql") + } + provisioner "local-exec" { + command = <