diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_breakdown.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_breakdown.sql index 8f9907b22..ae1ff0698 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_breakdown.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_breakdown.sql @@ -4,7 +4,7 @@ select 'arn:aws:ec2:' || product_region_code::text || ':' || line_item_usage_account_id::text || ':instance/' || line_item_resource_id::text AS arn, product_region_code as region, SUM(line_item_unblended_cost) AS cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} where line_item_product_code = 'AmazonEC2' and line_item_resource_id like 'i-%' group by arn, region diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_instance_type.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_instance_type.sql index 59d4e0af5..a691b7ce2 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_instance_type.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_instance_type.sql @@ -2,7 +2,7 @@ SELECT ec2.instance_type, SUM(cu.line_item_unblended_cost) AS cost FROM - {{ var('cost_usage_table') }} AS cu + {{ adapter.quote(var('cost_usage_table')) }} AS cu JOIN aws_ec2_instances AS ec2 ON diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_region.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_region.sql index 89fa4dd7e..b99a7e59e 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_region.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_by_region.sql @@ -1,5 +1,5 @@ SELECT product_region_code, SUM(line_item_unblended_cost) as cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} where line_item_line_item_type = 'Usage' AND line_item_product_code = 'AmazonEC2' AND line_item_resource_id like 'i-%' diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_over_time.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_over_time.sql index 64cf234bc..37f2ff046 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_over_time.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_cost_over_time.sql @@ -1,7 +1,7 @@ SELECT DATE(line_item_usage_end_date) AS usage_date, SUM(line_item_unblended_cost) AS total_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'AmazonEC2' AND diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_instance_utilization_cost.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_instance_utilization_cost.sql index 096200b05..a79f3efe3 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_instance_utilization_cost.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_instance_utilization_cost.sql @@ -21,7 +21,7 @@ cost_by_region_resource AS ( line_item_resource_id, SUM(line_item_unblended_cost) AS cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id != '' AND line_item_product_code = 'AmazonEC2' diff --git a/transformations/aws/cost/models/ec2/aws_cost__ec2_overall_cost.sql b/transformations/aws/cost/models/ec2/aws_cost__ec2_overall_cost.sql index a09fb76b1..b8555d5b4 100644 --- a/transformations/aws/cost/models/ec2/aws_cost__ec2_overall_cost.sql +++ b/transformations/aws/cost/models/ec2/aws_cost__ec2_overall_cost.sql @@ -1,6 +1,6 @@ SELECT SUM(line_item_unblended_cost) AS total_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'AmazonEC2' AND diff --git a/transformations/aws/cost/models/general/aws_cost__beanstalk_tag_spend_allocation.sql b/transformations/aws/cost/models/general/aws_cost__beanstalk_tag_spend_allocation.sql index f44d52a05..93761734f 100644 --- a/transformations/aws/cost/models/general/aws_cost__beanstalk_tag_spend_allocation.sql +++ b/transformations/aws/cost/models/general/aws_cost__beanstalk_tag_spend_allocation.sql @@ -3,7 +3,7 @@ with all_costs as ( select resource_tags_aws_elasticbeanstalk_environment_id as elasticbeanstalk_environment_id, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost - from {{ var('cost_usage_table') }} + from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_elasticbeanstalk_environment_id, month ), cost_calcs as ( diff --git a/transformations/aws/cost/models/general/aws_cost__by_account.sql b/transformations/aws/cost/models/general/aws_cost__by_account.sql index 9b8dd2b52..9760d34bf 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_account.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_account.sql @@ -1,13 +1,13 @@ select bill_payer_account_id as account_id, sum(line_item_unblended_cost) as cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} where line_item_line_item_type = 'Usage' group by bill_payer_account_id having sum(line_item_unblended_cost) > 0 -- SELECT line_item_usage_account_id, SUM(line_item_unblended_cost) as cost --- FROM {{ var('cost_usage_table') }} +-- FROM {{ adapter.quote(var('cost_usage_table')) }} -- GROUP BY line_item_usage_account_id -- HAVING SUM(line_item_unblended_cost) > 0 -- ORDER BY SUM(line_item_unblended_cost) DESC \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__by_beanstalk_tag.sql b/transformations/aws/cost/models/general/aws_cost__by_beanstalk_tag.sql index eb948833a..2e85dc58d 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_beanstalk_tag.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_beanstalk_tag.sql @@ -1,6 +1,6 @@ select resource_tags_aws_elasticbeanstalk_environment_id as elasticbeanstalk_environment_id, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_elasticbeanstalk_environment_id, month having sum(line_item_unblended_cost) > 0 \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__by_cloudformation_tag.sql b/transformations/aws/cost/models/general/aws_cost__by_cloudformation_tag.sql index 92685257e..a021b9756 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_cloudformation_tag.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_cloudformation_tag.sql @@ -2,6 +2,6 @@ select resource_tags_aws_cloudformation_logical_id as cloudformation_logical_id, resource_tags_aws_cloudformation_stack_name as cloudformation_stack_name, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_cloudformation_logical_id, resource_tags_aws_cloudformation_stack_name, month having sum(line_item_unblended_cost) > 0 \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__by_container_usage.sql b/transformations/aws/cost/models/general/aws_cost__by_container_usage.sql index d631302f2..c27b58c41 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_container_usage.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_container_usage.sql @@ -7,7 +7,7 @@ SELECT SUM(CAST(line_item_usage_amount AS DOUBLE PRECISION)) AS sum_line_item_usage_amount, SUM(line_item_unblended_cost) sum_line_item_unblended_cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code IN ('AmazonECS','AmazonEKS') AND line_item_line_item_type IN ('DiscountedUsage', 'Usage') diff --git a/transformations/aws/cost/models/general/aws_cost__by_ecs_tag.sql b/transformations/aws/cost/models/general/aws_cost__by_ecs_tag.sql index 8eb0c57e5..dd6d3ffaa 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_ecs_tag.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_ecs_tag.sql @@ -1,6 +1,6 @@ select resource_tags_aws_ecs_cluster as ecs_cluster, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_ecs_cluster, month having sum(line_item_unblended_cost) > 0 \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__by_lambda_tag.sql b/transformations/aws/cost/models/general/aws_cost__by_lambda_tag.sql index 6db18bcd7..a3f3a4c26 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_lambda_tag.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_lambda_tag.sql @@ -1,6 +1,6 @@ select resource_tags_aws_lambda_function_name as lambda_function_name, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost -from {{ var('cost_usage_table') }} +from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_lambda_function_name, month having sum(line_item_unblended_cost) > 0 \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__by_lambda_usage.sql b/transformations/aws/cost/models/general/aws_cost__by_lambda_usage.sql index cc78e08f1..1975b5c51 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_lambda_usage.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_lambda_usage.sql @@ -17,7 +17,7 @@ SELECT pricing_term, SUM(CAST(line_item_usage_amount AS DOUBLE PRECISION)) AS sum_line_item_usage_amount, SUM(line_item_unblended_cost) AS sum_line_item_unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'AWS Lambda' AND line_item_line_item_type LIKE '%Usage%' diff --git a/transformations/aws/cost/models/general/aws_cost__by_product.sql b/transformations/aws/cost/models/general/aws_cost__by_product.sql index cc34893e7..398e1c683 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_product.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_product.sql @@ -1,5 +1,5 @@ SELECT line_item_product_code, SUM(line_item_unblended_cost) as cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} where line_item_line_item_type = 'Usage' GROUP BY line_item_product_code HAVING SUM(line_item_unblended_cost) > 0 diff --git a/transformations/aws/cost/models/general/aws_cost__by_rds_usage.sql b/transformations/aws/cost/models/general/aws_cost__by_rds_usage.sql index 094cb7532..c64b37fb1 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_rds_usage.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_rds_usage.sql @@ -14,7 +14,7 @@ SELECT END) AS sum_line_item_usage_amount, SUM(line_item_unblended_cost) AS sum_line_item_unblended_cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Relational Database Service' GROUP BY diff --git a/transformations/aws/cost/models/general/aws_cost__by_regions.sql b/transformations/aws/cost/models/general/aws_cost__by_regions.sql index fb3d12a43..63be4dd65 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_regions.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_regions.sql @@ -1,7 +1,7 @@ SELECT product_location, SUM(line_item_unblended_cost) AS cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id !='' and product_location_type = 'AWS Region' GROUP BY product_location HAVING SUM(line_item_unblended_cost) > 0 diff --git a/transformations/aws/cost/models/general/aws_cost__by_resources.sql b/transformations/aws/cost/models/general/aws_cost__by_resources.sql index 77364893e..3fe316e0e 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_resources.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_resources.sql @@ -2,7 +2,7 @@ SELECT line_item_resource_id, line_item_product_code, SUM(line_item_unblended_cost) AS cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id !='' GROUP BY line_item_resource_id, line_item_product_code HAVING SUM(line_item_unblended_cost) > 0 diff --git a/transformations/aws/cost/models/general/aws_cost__by_tag.sql b/transformations/aws/cost/models/general/aws_cost__by_tag.sql index ad9c5be17..2cc15e6d0 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_tag.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_tag.sql @@ -7,7 +7,7 @@ with raw_tags as EXTRACT(month FROM bill_billing_period_start_date) AS month, line_item_unblended_cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} LEFT JOIN LATERAL ( SELECT jsonb_array_elements(resource_tags::jsonb) ->> 'key' AS aws_tag_key, diff --git a/transformations/aws/cost/models/general/aws_cost__by_untagged_resource.sql b/transformations/aws/cost/models/general/aws_cost__by_untagged_resource.sql index 10612717a..c0e75f685 100644 --- a/transformations/aws/cost/models/general/aws_cost__by_untagged_resource.sql +++ b/transformations/aws/cost/models/general/aws_cost__by_untagged_resource.sql @@ -5,7 +5,7 @@ product_servicecode as service, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost from -{{ var('cost_usage_table') }} +{{ adapter.quote(var('cost_usage_table')) }} where resource_tags = '[]' or resource_tags is null group by account_id, resource_id, service, month having sum(line_item_unblended_cost) > 0 \ No newline at end of file diff --git a/transformations/aws/cost/models/general/aws_cost__cloudformation_tag_spend_allocation.sql b/transformations/aws/cost/models/general/aws_cost__cloudformation_tag_spend_allocation.sql index 1dfba3982..718f8b12f 100644 --- a/transformations/aws/cost/models/general/aws_cost__cloudformation_tag_spend_allocation.sql +++ b/transformations/aws/cost/models/general/aws_cost__cloudformation_tag_spend_allocation.sql @@ -4,7 +4,7 @@ with all_costs as ( resource_tags_aws_cloudformation_stack_name as cloudformation_stack_name, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost - from {{ var('cost_usage_table') }} + from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_cloudformation_logical_id, resource_tags_aws_cloudformation_stack_name, month ), cost_calcs as ( diff --git a/transformations/aws/cost/models/general/aws_cost__ecs_tag_spend_allocation.sql b/transformations/aws/cost/models/general/aws_cost__ecs_tag_spend_allocation.sql index 794a0818c..312aaf5e8 100644 --- a/transformations/aws/cost/models/general/aws_cost__ecs_tag_spend_allocation.sql +++ b/transformations/aws/cost/models/general/aws_cost__ecs_tag_spend_allocation.sql @@ -3,7 +3,7 @@ with all_costs as ( select resource_tags_aws_ecs_cluster as ecs_cluster, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost - from {{ var('cost_usage_table') }} + from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_ecs_cluster, month ), cost_calcs as ( diff --git a/transformations/aws/cost/models/general/aws_cost__gp2_ebs_volumes.sql b/transformations/aws/cost/models/general/aws_cost__gp2_ebs_volumes.sql index e233dbdb1..5586162d7 100644 --- a/transformations/aws/cost/models/general/aws_cost__gp2_ebs_volumes.sql +++ b/transformations/aws/cost/models/general/aws_cost__gp2_ebs_volumes.sql @@ -13,7 +13,7 @@ FROM ( SELECT line_item_resource_id, line_item_product_code, SUM(line_item_unblended_cost) AS cost - FROM {{ var('cost_usage_table') }} + FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id LIKE 'vol-%' GROUP BY diff --git a/transformations/aws/cost/models/general/aws_cost__lambda_tag_spend_allocation.sql b/transformations/aws/cost/models/general/aws_cost__lambda_tag_spend_allocation.sql index 0bedb2ee8..05fdca49e 100644 --- a/transformations/aws/cost/models/general/aws_cost__lambda_tag_spend_allocation.sql +++ b/transformations/aws/cost/models/general/aws_cost__lambda_tag_spend_allocation.sql @@ -3,7 +3,7 @@ with all_costs as ( select resource_tags_aws_lambda_function_name as lambda_function_name, extract(month from bill_billing_period_start_date) as month, sum(line_item_unblended_cost) as sum_line_item_unblended_cost - from {{ var('cost_usage_table') }} + from {{ adapter.quote(var('cost_usage_table')) }} group by resource_tags_aws_lambda_function_name, month ), cost_calcs as ( diff --git a/transformations/aws/cost/models/general/aws_cost__over_time.sql b/transformations/aws/cost/models/general/aws_cost__over_time.sql index 913388a5c..bc3dd6507 100644 --- a/transformations/aws/cost/models/general/aws_cost__over_time.sql +++ b/transformations/aws/cost/models/general/aws_cost__over_time.sql @@ -2,7 +2,7 @@ SELECT line_item_usage_start_date, line_item_usage_end_date, SUM(line_item_unblended_cost) AS cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id !='' and product_location_type = 'AWS Region' GROUP BY line_item_usage_start_date, line_item_usage_end_date HAVING SUM(line_item_unblended_cost) > 0 diff --git a/transformations/aws/cost/models/general/aws_cost__over_time_date.sql b/transformations/aws/cost/models/general/aws_cost__over_time_date.sql index 514371d2d..6700b2c97 100644 --- a/transformations/aws/cost/models/general/aws_cost__over_time_date.sql +++ b/transformations/aws/cost/models/general/aws_cost__over_time_date.sql @@ -1,7 +1,7 @@ SELECT DATE(line_item_usage_end_date) AS usage_date, SUM(line_item_unblended_cost) AS total_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id != '' AND product_location_type = 'AWS Region' diff --git a/transformations/aws/cost/models/general/aws_cost__total.sql b/transformations/aws/cost/models/general/aws_cost__total.sql index f43ae422d..14ae3e32a 100644 --- a/transformations/aws/cost/models/general/aws_cost__total.sql +++ b/transformations/aws/cost/models/general/aws_cost__total.sql @@ -2,7 +2,7 @@ WITH totals AS ( SELECT line_item_line_item_type AS type, SUM(line_item_unblended_cost) AS total - FROM {{ var('cost_usage_table') }} + FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_line_item_type IN ('Credit', 'Usage') GROUP BY line_item_line_item_type ) diff --git a/transformations/aws/cost/models/general/aws_usage__data_usage_capacity.sql b/transformations/aws/cost/models/general/aws_usage__data_usage_capacity.sql index 431374f7d..beed6c2b2 100644 --- a/transformations/aws/cost/models/general/aws_usage__data_usage_capacity.sql +++ b/transformations/aws/cost/models/general/aws_usage__data_usage_capacity.sql @@ -4,7 +4,7 @@ select line_item_usage_type, sum(cast(line_item_usage_amount AS double precision)) as sum_line_item_usage_amount_hours from - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} where line_item_line_item_type like '%Usage%' group by diff --git a/transformations/aws/macros/recovery/recovery_cloudhsmv2_backups.sql b/transformations/aws/macros/recovery/recovery_cloudhsmv2_backups.sql index 67251219b..681c44c8d 100644 --- a/transformations/aws/macros/recovery/recovery_cloudhsmv2_backups.sql +++ b/transformations/aws/macros/recovery/recovery_cloudhsmv2_backups.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_cloudhsmv2_backups() %} with cloudhsmv2_backups_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'AWS CloudHSM' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_docdb_cluster_snapshots.sql b/transformations/aws/macros/recovery/recovery_docdb_cluster_snapshots.sql index 3a545ec3d..c3c5de311 100644 --- a/transformations/aws/macros/recovery/recovery_docdb_cluster_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_docdb_cluster_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_docdb_cluster_snapshots(framework, check_id) %} with docdb_cluster_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon DocumentDB' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_dynamodb_backups.sql b/transformations/aws/macros/recovery/recovery_dynamodb_backups.sql index 6bb2cb643..87233aec4 100644 --- a/transformations/aws/macros/recovery/recovery_dynamodb_backups.sql +++ b/transformations/aws/macros/recovery/recovery_dynamodb_backups.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_dynamodb_backups(framework, check_id) %} with dynamodb_backups_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon DynamoDB' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_dynamodb_table_continuous_backups.sql b/transformations/aws/macros/recovery/recovery_dynamodb_table_continuous_backups.sql index 9dd803a55..7fa9757ec 100644 --- a/transformations/aws/macros/recovery/recovery_dynamodb_table_continuous_backups.sql +++ b/transformations/aws/macros/recovery/recovery_dynamodb_table_continuous_backups.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_dynamodb_table_continuous_backups(framework, check_id) %} with dynamodb_table_continuous_backups_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon DynamoDB' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_ec2_ebs_snapshots.sql b/transformations/aws/macros/recovery/recovery_ec2_ebs_snapshots.sql index f1d27f2a1..7b3dfec0f 100644 --- a/transformations/aws/macros/recovery/recovery_ec2_ebs_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_ec2_ebs_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_ec2_ebs_snapshots(framework, check_id) %} with ec2_ebs_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Elastic Block Store' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_elasticache_snapshots.sql b/transformations/aws/macros/recovery/recovery_elasticache_snapshots.sql index 4c21e5f34..3b6e2e441 100644 --- a/transformations/aws/macros/recovery/recovery_elasticache_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_elasticache_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_elasticache_snapshots(framework, check_id) %} with elasticache_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon ElastiCache' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_fsx_backups.sql b/transformations/aws/macros/recovery/recovery_fsx_backups.sql index 82718a8b4..e0e64a3b1 100644 --- a/transformations/aws/macros/recovery/recovery_fsx_backups.sql +++ b/transformations/aws/macros/recovery/recovery_fsx_backups.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_fsx_backups(framework, check_id) %} with fsx_backups_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon FSx' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_fsx_snapshots.sql b/transformations/aws/macros/recovery/recovery_fsx_snapshots.sql index 2059cff44..b9f896cab 100644 --- a/transformations/aws/macros/recovery/recovery_fsx_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_fsx_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_fsx_snapshots(framework, check_id) %} with fsx_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon FSx' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_lightsail_database_snapshots.sql b/transformations/aws/macros/recovery/recovery_lightsail_database_snapshots.sql index ef129a927..c73b73842 100644 --- a/transformations/aws/macros/recovery/recovery_lightsail_database_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_lightsail_database_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_lightsail_database_snapshots(framework, check_id) %} with db_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Lightsail' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_lightsail_disk_snapshots.sql b/transformations/aws/macros/recovery/recovery_lightsail_disk_snapshots.sql index 5e01c9a49..35acf4954 100644 --- a/transformations/aws/macros/recovery/recovery_lightsail_disk_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_lightsail_disk_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_lightsail_disk_snapshots(framework, check_id) %} with disk_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Lightsail' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_lightsail_instance_snapshots.sql b/transformations/aws/macros/recovery/recovery_lightsail_instance_snapshots.sql index 534e2ebcf..00ef4c2f1 100644 --- a/transformations/aws/macros/recovery/recovery_lightsail_instance_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_lightsail_instance_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_lightsail_instance_snapshots(framework, check_id) %} with instance_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Lightsail' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_neptune_cluster_snapshots.sql b/transformations/aws/macros/recovery/recovery_neptune_cluster_snapshots.sql index 65c3c12a7..d9973d58e 100644 --- a/transformations/aws/macros/recovery/recovery_neptune_cluster_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_neptune_cluster_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_neptune_cluster_snapshots(framework, check_id) %} with neptune_cluster_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Neptune' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_rds_cluster_snapshots.sql b/transformations/aws/macros/recovery/recovery_rds_cluster_snapshots.sql index 472e563ad..82be9b5fb 100644 --- a/transformations/aws/macros/recovery/recovery_rds_cluster_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_rds_cluster_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_rds_cluster_snapshots(framework, check_id) %} with rds_cluster_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon RDS' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_rds_db_snapshots.sql b/transformations/aws/macros/recovery/recovery_rds_db_snapshots.sql index 071be9790..2b05eeb93 100644 --- a/transformations/aws/macros/recovery/recovery_rds_db_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_rds_db_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_rds_db_snapshots() %} with rds_db_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon RDS' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/recovery/recovery_redshift_snapshots.sql b/transformations/aws/macros/recovery/recovery_redshift_snapshots.sql index 88f724a57..5fbd70445 100644 --- a/transformations/aws/macros/recovery/recovery_redshift_snapshots.sql +++ b/transformations/aws/macros/recovery/recovery_redshift_snapshots.sql @@ -7,7 +7,7 @@ {% macro postgres__recovery_redshift_snapshots(framework, check_id) %} with redshift_snapshots_cost as ( SELECT line_item_resource_id as resource_id, SUM(line_item_unblended_cost) as unblended_cost -FROM {{ var('cost_usage_table') }} +FROM {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_product_code = 'Amazon Redshift' GROUP BY line_item_resource_id ) diff --git a/transformations/aws/macros/under_utilized/under_utilized_dynamodb_tables_default.sql b/transformations/aws/macros/under_utilized/under_utilized_dynamodb_tables_default.sql index aa786ddd1..9962b19dd 100644 --- a/transformations/aws/macros/under_utilized/under_utilized_dynamodb_tables_default.sql +++ b/transformations/aws/macros/under_utilized/under_utilized_dynamodb_tables_default.sql @@ -63,7 +63,7 @@ cost_by_region_resource AS ( line_item_resource_id, SUM(line_item_unblended_cost) AS cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id != '' AND line_item_product_code = 'AmazonDynamoDB' diff --git a/transformations/aws/macros/under_utilized/under_utilized_ec2_instances_default.sql b/transformations/aws/macros/under_utilized/under_utilized_ec2_instances_default.sql index 8c1b00276..374b20713 100644 --- a/transformations/aws/macros/under_utilized/under_utilized_ec2_instances_default.sql +++ b/transformations/aws/macros/under_utilized/under_utilized_ec2_instances_default.sql @@ -29,7 +29,7 @@ cost_by_region_resource AS ( line_item_resource_id, SUM(line_item_unblended_cost) AS cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id != '' AND line_item_product_code = 'AmazonEC2' diff --git a/transformations/aws/macros/under_utilized/under_utilized_rds_clusters_and_instances_default.sql b/transformations/aws/macros/under_utilized/under_utilized_rds_clusters_and_instances_default.sql index e9b9e8890..36d64a962 100644 --- a/transformations/aws/macros/under_utilized/under_utilized_rds_clusters_and_instances_default.sql +++ b/transformations/aws/macros/under_utilized/under_utilized_rds_clusters_and_instances_default.sql @@ -67,7 +67,7 @@ cost_by_region_resource AS ( line_item_resource_id, SUM(line_item_unblended_cost) AS cost FROM - {{ var('cost_usage_table') }} + {{ adapter.quote(var('cost_usage_table')) }} WHERE line_item_resource_id != '' AND line_item_product_code = 'AmazonRDS'