cid-cmd 0.2.45__tar.gz → 4.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. {cid-cmd-0.2.45/cid_cmd.egg-info → cid_cmd-4.0.8}/PKG-INFO +58 -21
  2. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/README.md +52 -16
  3. cid_cmd-4.0.8/cid/_version.py +2 -0
  4. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/base.py +8 -0
  5. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/shared/customer_all.json +3 -3
  6. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/tao/dataset.json +12 -0
  7. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/cid/compute_savings_plan_eligible_spend.sql +4 -4
  8. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ec2_running_cost_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/cid/ec2_running_cost.sql +10 -5
  9. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ri_sp_mapping_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/cid/ri_sp_mapping.sql +10 -10
  10. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/cid/s3.sql +5 -4
  11. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/summary_view_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/cid/summary_view.sql +45 -27
  12. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/all_options.sql +8 -2
  13. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/auto_scale.json +1 -1
  14. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/ebs_volume.json +1 -1
  15. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/ec2_instance.json +1 -1
  16. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/lambda.json +1 -1
  17. cid_cmd-4.0.8/cid/builtin/core/data/queries/co/rds_database.json +521 -0
  18. cid_cmd-4.0.8/cid/builtin/core/data/queries/co/rds_instance_options.sql +135 -0
  19. cid_cmd-4.0.8/cid/builtin/core/data/queries/co/rds_storage_options.sql +135 -0
  20. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/hourly_view_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/cudos/hourly_view.sql +7 -4
  21. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/resource_view_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/cudos/resource_view.sql +18 -15
  22. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/kpi_ebs_snap_view.sql +5 -5
  23. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/kpi_ebs_storage_view.sql +30 -30
  24. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/kpi_instance_all_view.sql +53 -51
  25. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/kpi_s3_storage_view.sql +22 -20
  26. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/last_kpi_tracker_view.sql +7 -8
  27. cid_cmd-4.0.8/cid/builtin/core/data/queries/shared/account_map.sql +10 -0
  28. cid_cmd-4.0.8/cid/builtin/core/data/queries/shared/account_map_cur2.sql +10 -0
  29. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/account_map_dummy.sql +1 -1
  30. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/aws_accounts.sql +11 -6
  31. cid_cmd-4.0.8/cid/builtin/core/data/queries/shared/cur.yaml +89 -0
  32. cid_cmd-4.0.8/cid/builtin/core/data/queries/shared/customer_all_unlimited.sql +204 -0
  33. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/payer_account_name_map.sql +1 -5
  34. cid_cmd-4.0.8/cid/builtin/core/data/queries/shared/ta_descriptions.sql +508 -0
  35. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/tao/glue_table.json +1 -1
  36. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/trends/daily_anomaly_detection.sql +2 -2
  37. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/trends/monthly_anomaly_detection.sql +5 -2
  38. cid-cmd-0.2.45/cid/builtin/core/data/queries/trends/monthly_bill_by_account_sp_ri.sql → cid_cmd-4.0.8/cid/builtin/core/data/queries/trends/monthly_bill_by_account.sql +3 -3
  39. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/resources.yaml +372 -74
  40. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/cli.py +84 -29
  41. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/commands/init_qs.py +16 -11
  42. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/common.py +502 -313
  43. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/export.py +117 -36
  44. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/__init__.py +11 -4
  45. cid_cmd-4.0.8/cid/helpers/account_map.py +312 -0
  46. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/athena.py +236 -147
  47. cid_cmd-4.0.8/cid/helpers/cloudformation.py +58 -0
  48. cid_cmd-4.0.8/cid/helpers/cur.py +363 -0
  49. cid_cmd-4.0.8/cid/helpers/cur_proxy.py +614 -0
  50. cid_cmd-4.0.8/cid/helpers/glue.py +95 -0
  51. cid_cmd-4.0.8/cid/helpers/iam.py +512 -0
  52. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/quicksight/__init__.py +200 -68
  53. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/quicksight/dashboard.py +74 -48
  54. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/quicksight/datasource.py +7 -0
  55. cid_cmd-4.0.8/cid/helpers/quicksight/definition.py +68 -0
  56. cid_cmd-4.0.8/cid/helpers/quicksight/template.py +36 -0
  57. cid_cmd-4.0.8/cid/helpers/quicksight/version.py +81 -0
  58. cid_cmd-4.0.8/cid/helpers/s3.py +90 -0
  59. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/logger.py +11 -4
  60. cid_cmd-4.0.8/cid/test/python/test_isolated_parameters.py +12 -0
  61. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/utils.py +29 -15
  62. {cid-cmd-0.2.45 → cid_cmd-4.0.8/cid_cmd.egg-info}/PKG-INFO +58 -21
  63. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid_cmd.egg-info/SOURCES.txt +12 -21
  64. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid_cmd.egg-info/requires.txt +2 -1
  65. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/setup.cfg +4 -3
  66. cid-cmd-0.2.45/cid/_version.py +0 -2
  67. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ec2_running_cost.sql +0 -30
  68. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ec2_running_cost_ri.sql +0 -29
  69. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ec2_running_cost_sp.sql +0 -30
  70. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ri_sp_mapping.sql +0 -71
  71. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ri_sp_mapping_ri.sql +0 -61
  72. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/ri_sp_mapping_sp.sql +0 -61
  73. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/summary_view.sql +0 -87
  74. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/summary_view_ri.sql +0 -78
  75. cid-cmd-0.2.45/cid/builtin/core/data/queries/cid/summary_view_sp.sql +0 -82
  76. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/hourly_view.sql +0 -25
  77. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/hourly_view_ri.sql +0 -25
  78. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/hourly_view_sp.sql +0 -25
  79. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/resource_view.sql +0 -39
  80. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/resource_view_ri.sql +0 -39
  81. cid-cmd-0.2.45/cid/builtin/core/data/queries/cudos/resource_view_sp.sql +0 -39
  82. cid-cmd-0.2.45/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noRI.sql +0 -269
  83. cid-cmd-0.2.45/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noRISP.sql +0 -262
  84. cid-cmd-0.2.45/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noSP.sql +0 -265
  85. cid-cmd-0.2.45/cid/builtin/core/data/queries/shared/account_map.sql +0 -10
  86. cid-cmd-0.2.45/cid/builtin/core/data/queries/shared/ta_descriptions.sql +0 -322
  87. cid-cmd-0.2.45/cid/builtin/core/data/queries/trends/monthly_bill_by_account.sql +0 -59
  88. cid-cmd-0.2.45/cid/builtin/core/data/queries/trends/monthly_bill_by_account_ri.sql +0 -62
  89. cid-cmd-0.2.45/cid/builtin/core/data/queries/trends/monthly_bill_by_account_sp.sql +0 -64
  90. cid-cmd-0.2.45/cid/helpers/account_map.py +0 -309
  91. cid-cmd-0.2.45/cid/helpers/cur.py +0 -230
  92. cid-cmd-0.2.45/cid/helpers/glue.py +0 -39
  93. cid-cmd-0.2.45/cid/helpers/quicksight/template.py +0 -93
  94. cid-cmd-0.2.45/cid/helpers/s3.py +0 -83
  95. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/LICENSE +0 -0
  96. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/MANIFEST.in +0 -0
  97. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/__init__.py +0 -0
  98. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/__init__.py +0 -0
  99. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/__init__.py +0 -0
  100. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cid/compute.json +0 -0
  101. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cid/ec2_running_cost.json +0 -0
  102. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cid/s3_view.json +0 -0
  103. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cid/summary_view.json +0 -0
  104. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/co/dataset.json +0 -0
  105. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cudos/hourly_view.json +0 -0
  106. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/cudos/resource_view.json +0 -0
  107. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/kpi/kpi_ebs_snap.json +0 -0
  108. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/kpi/kpi_ebs_storage_all.json +0 -0
  109. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/kpi/kpi_instance_all.json +0 -0
  110. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/kpi/kpi_s3_storage_all.json +0 -0
  111. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/kpi/kpi_tracker.json +0 -0
  112. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/trends/daily_anomaly_detection.json +0 -0
  113. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/trends/monthly_anomaly_detection.json +0 -0
  114. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/datasets/trends/monthly_bill_by_account.json +0 -0
  115. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/permissions/dashboard_permissions.json +0 -0
  116. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/permissions/dashboard_permissions_namespace.json +0 -0
  117. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/permissions/data_set_permissions.json +0 -0
  118. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/permissions/data_source_permissions.json +0 -0
  119. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/permissions/folder_permissions.json +0 -0
  120. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/auto_scale_options.sql +0 -0
  121. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/ebs_volume_options.sql +0 -0
  122. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/ec2_instance_options.sql +0 -0
  123. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/co/lambda_options.sql +0 -0
  124. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/kpi/first_kpi_instance_mapping_view.sql +0 -0
  125. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/aws_regions.sql +0 -0
  126. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/aws_service_category_map.sql +0 -0
  127. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/shared/business_units_map.sql +0 -0
  128. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/builtin/core/data/queries/tao/ta_org_view.sql +0 -0
  129. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/commands/__init__.py +0 -0
  130. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/commands/command_base.py +0 -0
  131. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/exceptions.py +0 -0
  132. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/csv2view.py +0 -0
  133. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/diff.py +0 -0
  134. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/organizations.py +0 -0
  135. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/quicksight/dataset.py +0 -0
  136. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/quicksight/resource.py +0 -0
  137. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/randtime.py +0 -0
  138. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/helpers/timezone.py +0 -0
  139. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/plugin.py +0 -0
  140. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/test/python/test_csv2view.py +0 -0
  141. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid/test/python/test_merge.py +0 -0
  142. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid_cmd.egg-info/dependency_links.txt +0 -0
  143. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid_cmd.egg-info/entry_points.txt +0 -0
  144. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/cid_cmd.egg-info/top_level.txt +0 -0
  145. {cid-cmd-0.2.45 → cid_cmd-4.0.8}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: cid-cmd
3
- Version: 0.2.45
3
+ Version: 4.0.8
4
4
  Summary: Cloud Intelligence Dashboards deployment helper tool
5
5
  Home-page: https://github.com/aws-samples/aws-cudos-framework-deployment
6
6
  Author: AWS CUDOS Team
@@ -9,20 +9,21 @@ Keywords: aws,cmd,cli,cost intelligence dashboards
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.7
13
- Classifier: Programming Language :: Python :: 3.8
14
12
  Classifier: Programming Language :: Python :: 3.9
15
13
  Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: setuptools
19
- Requires-Dist: boto3>=1.29.5
19
+ Requires-Dist: boto3>=1.35.86
20
20
  Requires-Dist: Click>=8.0
21
21
  Requires-Dist: PyYAML
22
22
  Requires-Dist: requests
23
23
  Requires-Dist: tzlocal>=4.0
24
24
  Requires-Dist: six>=1.15
25
25
  Requires-Dist: questionary>=1.10
26
+ Requires-Dist: tqdm
26
27
 
27
28
  # Cloud Intelligence Dashboards (CUDOS Framework)
28
29
 
@@ -42,14 +43,15 @@ We recommend cid-cmd tool via [AWS CloudShell](https://console.aws.amazon.com/cl
42
43
  ---
43
44
  | Dashboard documentation | Demo URL | Prerequisites URL |
44
45
  | --- | --- | --- |
45
- | [CUDOS Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cudos-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cudos) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
46
- | [Cost Intelligence Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cost-intelligence-dashboard-(cid)) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cost_intelligence_dashboard) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
46
+ | [CUDOS Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cudos-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cudos) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
47
+ | [Cost Intelligence Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cost-intelligence-dashboard-(cid)) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cost_intelligence_dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
47
48
  | [Trusted Advisor Organisation (TAO) Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/trusted-advisor) | [demo](https://cid.workshops.aws.dev/demo?dashboard=tao-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/trusted-advisor/prerequisites) |
48
- | [Trends Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/trends) | [demo](https://cid.workshops.aws.dev/demo?dashboard=trends-dashboard) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
49
- | [KPI Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#kpi-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=kpi) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
49
+ | [Trends Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/trends) | [demo](https://cid.workshops.aws.dev/demo?dashboard=trends-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
50
+ | [KPI Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#kpi-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=kpi) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
50
51
  | [Compute Optimizer Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/compute-optimizer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=compute-optimizer-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/compute-optimizer/prerequisites) |
51
52
  | [Cost Anomaly Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/cost-anomaly) | [demo](https://cid.workshops.aws.dev/demo?dashboard=aws-cost-anomalies) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/cost-anomaly/prerequisites) |
52
- | [Data Transfer Cost Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/data-transfer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=datatransfer-cost-analysis-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi) |
53
+ | [Data Transfer Cost Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/data-transfer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=datatransfer-cost-analysis-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
54
+ | [AWS Budgets Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/aws-budgets) | [demo](https://cid.workshops.aws.dev/demo?dashboard=aws-budgets) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/aws-budgets#deploy-via-cid-tool) |
53
55
 
54
56
  See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/en-US/dashboards).
55
57
 
@@ -70,7 +72,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
70
72
 
71
73
  Automation requires Python 3
72
74
 
73
- 2. Make sure you have latest pip package installed
75
+ 2. Make sure you have the latest pip package installed
74
76
  ```bash
75
77
  python3 -m ensurepip --upgrade
76
78
  ```
@@ -80,7 +82,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
80
82
  pip3 install --upgrade cid-cmd
81
83
  ```
82
84
 
83
- #### Dasbhoard Deployment
85
+ #### Dashboard Deployment
84
86
 
85
87
  ```bash
86
88
  cid-cmd deploy
@@ -92,16 +94,19 @@ Update only Dashboard
92
94
  ```bash
93
95
  cid-cmd update
94
96
  ```
95
- Update dashboard and all dependenies (Datasets and Athena View). WARNING: this will overide any customization of SQL files and Datasets.
97
+ Update dashboard and all dependencies (Datasets and Athena View). WARNING: this will override any customization of SQL files and Datasets.
96
98
  ```bash
97
99
  cid-cmd update --force --recursive
98
100
  ```
99
- #### Show Dashboard status
101
+
102
+ #### Show Dashboard Status
100
103
  Show dashboards status
101
104
 
102
105
  ```bash
103
106
  cid-cmd status
104
107
  ```
108
+ [<img width="558" alt="status" src="https://github.com/aws-samples/aws-cudos-framework-deployment/assets/82834333/cae2015f-0f81-4593-80b3-c67ec1200fcd">](https://www.youtube.com/watch?v=ivr1MoGaApM)
109
+
105
110
 
106
111
  #### Share QuickSight resources
107
112
  ```bash
@@ -109,10 +114,40 @@ cid-cmd share
109
114
  ```
110
115
 
111
116
  #### Initialize Amazon QuickSight
112
- One time action to intialize Amazon QuickSight Enerprise Edition.
117
+ One time action to initialize Amazon QuickSight Enterprise Edition.
113
118
 
114
119
  ```bash
115
- cid-cmd initqs
120
+ cid-cmd init-qs
121
+ ```
122
+
123
+ #### Initialize CUR
124
+ One time action to initialize Athena table and Crawler from s3 with CUR data. Currently only CUR1 supported.
125
+
126
+ ```bash
127
+ cid-cmd init-cur
128
+ ```
129
+
130
+ #### Create CUR proxy
131
+ There are 2 CUR formats that `cid-cmd` supports. CUR1 and CUR2 have slightly different fields structure. Each dashboard can be developed using CUR2 or CUR1, but on installation `cid-cmd` will deploy a special Athena View "CUR proxy". This View will play a role of compatibility layer between the CUR version used by Dashboard and available CUR. This View can be extended as new dashboard request CUR fields.
132
+
133
+ Please note that Cost Allocation Tags and Cost Categories are not present in CUR Proxy by default. You will need to add these fields by modifying CUR Proxy in Athena or using `cid-cmd` tool:
134
+
135
+ For CUR2 proxy (using CUR1 data as source)
136
+ ```bash
137
+ cid-cmd create-cur-proxy -vv \
138
+ --cur-version '2' \
139
+ --cur-table-name 'mycur1' \
140
+ --athena-workgroup 'primary' \
141
+ --fields "resource_tags['user_cost_center'],resource_tags['user_owner']"
142
+ ```
143
+
144
+ For CUR1 proxy (using CUR2 data as source)
145
+ ```bash
146
+ cid-cmd create-cur-proxy -vv \
147
+ --cur-version '1' \
148
+ --cur-table-name 'mycur2' \
149
+ --athena-workgroup 'primary' \
150
+ --fields "resource_tags_user_cost_center,resource_tags_user_owner"
116
151
  ```
117
152
 
118
153
 
@@ -121,9 +156,11 @@ Delete Dashboards and all dependencies unused by other CID-managed dashboards.(i
121
156
  ```bash
122
157
  cid-cmd delete
123
158
  ```
159
+
160
+
124
161
  #### Delete Command Options:
125
162
  ```
126
- --dashboard-id TEXT QuickSight dashboard id
163
+ --dashboard-id TEXT QuickSight dashboard id
127
164
  --athena-database TEXT Athena database
128
165
  ```
129
166
 
@@ -155,15 +192,15 @@ This command generates a SQL file that you can execute. Please mind [Athena Serv
155
192
 
156
193
 
157
194
  ## Cloud Formation
158
- CID is also provided in a form of CloudFormation telmplates. See detailed instuctions in the [Well Architected Labs](https://wellarchitectedlabs.com/cost/200_labs/200_cloud_intelligence/cost-usage-report-dashboards/dashboards/deploy_dashboards/) site.
195
+ CID is also provided in a form of CloudFormation templates. See detailed instructions in the [Well Architected Labs](https://wellarchitectedlabs.com/cost/200_labs/200_cloud_intelligence/cost-usage-report-dashboards/dashboards/deploy_dashboards/) site.
159
196
 
160
197
  ## Terraform
161
- CID offers a set of Terraform modules to deploy CUR replicaion and CID dashboards. These modules act as a wrapper around CloudFormation.
198
+ CID offers a set of Terraform modules to deploy CUR replication and CID dashboards. Refer to these [deployment instructions](terraform-modules/README.md) for details of
199
+ how to deploy CID dashboards with these modules.
162
200
 
163
201
  1. Create a bucket for consolidating CUR [terraform-modules/cur-setup-destination/](terraform-modules/cur-setup-destination/)
164
202
  2. Create a CUR in Payer Account(s) [terraform-modules/cur-setup-source/](terraform-modules/cur-setup-source/)
165
- 3. Create Dashboards [terraform-modules/cid-dashboards/](terraform-modules/cid-dashboards/)
166
-
203
+ 3. Create Dashboards (wrapper around CloudFormation) [terraform-modules/cid-dashboards/](terraform-modules/cid-dashboards/)
167
204
 
168
205
  ## Rights Management
169
206
  The ownership of CID is usually with the FinOps team, who do not have administrative access. However, they require specific privileges to install and operate CID dashboards. To assist the Admin team in granting the necessary privileges to the CID owners, a CFN template is provided. This template, located at [CFN template](cfn-templates/cid-admin-policies.yaml), takes an IAM role name as a parameter and adds the required policies to the role.
@@ -16,14 +16,15 @@ We recommend cid-cmd tool via [AWS CloudShell](https://console.aws.amazon.com/cl
16
16
  ---
17
17
  | Dashboard documentation | Demo URL | Prerequisites URL |
18
18
  | --- | --- | --- |
19
- | [CUDOS Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cudos-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cudos) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
20
- | [Cost Intelligence Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cost-intelligence-dashboard-(cid)) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cost_intelligence_dashboard) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
19
+ | [CUDOS Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cudos-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cudos) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
20
+ | [Cost Intelligence Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#cost-intelligence-dashboard-(cid)) | [demo](https://cid.workshops.aws.dev/demo?dashboard=cost_intelligence_dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
21
21
  | [Trusted Advisor Organisation (TAO) Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/trusted-advisor) | [demo](https://cid.workshops.aws.dev/demo?dashboard=tao-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/trusted-advisor/prerequisites) |
22
- | [Trends Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/trends) | [demo](https://cid.workshops.aws.dev/demo?dashboard=trends-dashboard) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
23
- | [KPI Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#kpi-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=kpi) | [link](https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting) |
22
+ | [Trends Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/trends) | [demo](https://cid.workshops.aws.dev/demo?dashboard=trends-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
23
+ | [KPI Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi#kpi-dashboard) | [demo](https://cid.workshops.aws.dev/demo?dashboard=kpi) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
24
24
  | [Compute Optimizer Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/compute-optimizer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=compute-optimizer-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/compute-optimizer/prerequisites) |
25
25
  | [Cost Anomaly Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/cost-anomaly) | [demo](https://cid.workshops.aws.dev/demo?dashboard=aws-cost-anomalies) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/cost-anomaly/prerequisites) |
26
- | [Data Transfer Cost Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/data-transfer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=datatransfer-cost-analysis-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi) |
26
+ | [Data Transfer Cost Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/additional/data-transfer) | [demo](https://cid.workshops.aws.dev/demo?dashboard=datatransfer-cost-analysis-dashboard) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/foundational/cudos-cid-kpi/deploy) (Steps 1 and 2) |
27
+ | [AWS Budgets Dashboard](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/aws-budgets) | [demo](https://cid.workshops.aws.dev/demo?dashboard=aws-budgets) | [link](https://catalog.workshops.aws/awscid/en-US/dashboards/advanced/aws-budgets#deploy-via-cid-tool) |
27
28
 
28
29
  See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/en-US/dashboards).
29
30
 
@@ -44,7 +45,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
44
45
 
45
46
  Automation requires Python 3
46
47
 
47
- 2. Make sure you have latest pip package installed
48
+ 2. Make sure you have the latest pip package installed
48
49
  ```bash
49
50
  python3 -m ensurepip --upgrade
50
51
  ```
@@ -54,7 +55,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
54
55
  pip3 install --upgrade cid-cmd
55
56
  ```
56
57
 
57
- #### Dasbhoard Deployment
58
+ #### Dashboard Deployment
58
59
 
59
60
  ```bash
60
61
  cid-cmd deploy
@@ -66,16 +67,19 @@ Update only Dashboard
66
67
  ```bash
67
68
  cid-cmd update
68
69
  ```
69
- Update dashboard and all dependenies (Datasets and Athena View). WARNING: this will overide any customization of SQL files and Datasets.
70
+ Update dashboard and all dependencies (Datasets and Athena View). WARNING: this will override any customization of SQL files and Datasets.
70
71
  ```bash
71
72
  cid-cmd update --force --recursive
72
73
  ```
73
- #### Show Dashboard status
74
+
75
+ #### Show Dashboard Status
74
76
  Show dashboards status
75
77
 
76
78
  ```bash
77
79
  cid-cmd status
78
80
  ```
81
+ [<img width="558" alt="status" src="https://github.com/aws-samples/aws-cudos-framework-deployment/assets/82834333/cae2015f-0f81-4593-80b3-c67ec1200fcd">](https://www.youtube.com/watch?v=ivr1MoGaApM)
82
+
79
83
 
80
84
  #### Share QuickSight resources
81
85
  ```bash
@@ -83,10 +87,40 @@ cid-cmd share
83
87
  ```
84
88
 
85
89
  #### Initialize Amazon QuickSight
86
- One time action to intialize Amazon QuickSight Enerprise Edition.
90
+ One time action to initialize Amazon QuickSight Enterprise Edition.
87
91
 
88
92
  ```bash
89
- cid-cmd initqs
93
+ cid-cmd init-qs
94
+ ```
95
+
96
+ #### Initialize CUR
97
+ One time action to initialize Athena table and Crawler from s3 with CUR data. Currently only CUR1 supported.
98
+
99
+ ```bash
100
+ cid-cmd init-cur
101
+ ```
102
+
103
+ #### Create CUR proxy
104
+ There are 2 CUR formats that `cid-cmd` supports. CUR1 and CUR2 have slightly different fields structure. Each dashboard can be developed using CUR2 or CUR1, but on installation `cid-cmd` will deploy a special Athena View "CUR proxy". This View will play a role of compatibility layer between the CUR version used by Dashboard and available CUR. This View can be extended as new dashboard request CUR fields.
105
+
106
+ Please note that Cost Allocation Tags and Cost Categories are not present in CUR Proxy by default. You will need to add these fields by modifying CUR Proxy in Athena or using `cid-cmd` tool:
107
+
108
+ For CUR2 proxy (using CUR1 data as source)
109
+ ```bash
110
+ cid-cmd create-cur-proxy -vv \
111
+ --cur-version '2' \
112
+ --cur-table-name 'mycur1' \
113
+ --athena-workgroup 'primary' \
114
+ --fields "resource_tags['user_cost_center'],resource_tags['user_owner']"
115
+ ```
116
+
117
+ For CUR1 proxy (using CUR2 data as source)
118
+ ```bash
119
+ cid-cmd create-cur-proxy -vv \
120
+ --cur-version '1' \
121
+ --cur-table-name 'mycur2' \
122
+ --athena-workgroup 'primary' \
123
+ --fields "resource_tags_user_cost_center,resource_tags_user_owner"
90
124
  ```
91
125
 
92
126
 
@@ -95,9 +129,11 @@ Delete Dashboards and all dependencies unused by other CID-managed dashboards.(i
95
129
  ```bash
96
130
  cid-cmd delete
97
131
  ```
132
+
133
+
98
134
  #### Delete Command Options:
99
135
  ```
100
- --dashboard-id TEXT QuickSight dashboard id
136
+ --dashboard-id TEXT QuickSight dashboard id
101
137
  --athena-database TEXT Athena database
102
138
  ```
103
139
 
@@ -129,15 +165,15 @@ This command generates a SQL file that you can execute. Please mind [Athena Serv
129
165
 
130
166
 
131
167
  ## Cloud Formation
132
- CID is also provided in a form of CloudFormation telmplates. See detailed instuctions in the [Well Architected Labs](https://wellarchitectedlabs.com/cost/200_labs/200_cloud_intelligence/cost-usage-report-dashboards/dashboards/deploy_dashboards/) site.
168
+ CID is also provided in a form of CloudFormation templates. See detailed instructions in the [Well Architected Labs](https://wellarchitectedlabs.com/cost/200_labs/200_cloud_intelligence/cost-usage-report-dashboards/dashboards/deploy_dashboards/) site.
133
169
 
134
170
  ## Terraform
135
- CID offers a set of Terraform modules to deploy CUR replicaion and CID dashboards. These modules act as a wrapper around CloudFormation.
171
+ CID offers a set of Terraform modules to deploy CUR replication and CID dashboards. Refer to these [deployment instructions](terraform-modules/README.md) for details of
172
+ how to deploy CID dashboards with these modules.
136
173
 
137
174
  1. Create a bucket for consolidating CUR [terraform-modules/cur-setup-destination/](terraform-modules/cur-setup-destination/)
138
175
  2. Create a CUR in Payer Account(s) [terraform-modules/cur-setup-source/](terraform-modules/cur-setup-source/)
139
- 3. Create Dashboards [terraform-modules/cid-dashboards/](terraform-modules/cid-dashboards/)
140
-
176
+ 3. Create Dashboards (wrapper around CloudFormation) [terraform-modules/cid-dashboards/](terraform-modules/cid-dashboards/)
141
177
 
142
178
  ## Rights Management
143
179
  The ownership of CID is usually with the FinOps team, who do not have administrative access. However, they require specific privileges to install and operate CID dashboards. To assist the Admin team in granting the necessary privileges to the CID owners, a CFN template is provided. This template, located at [CFN template](cfn-templates/cid-admin-policies.yaml), takes an IAM role name as a parameter and adds the required policies to the role.
@@ -0,0 +1,2 @@
1
+ __version__ = '4.0.8'
2
+
@@ -21,6 +21,14 @@ class CidBase():
21
21
  def account_id(self) -> str:
22
22
  return self.awsIdentity.get('Account')
23
23
 
24
+ @property
25
+ def domain(self) -> str:
26
+ if self.partition == 'aws-us-gov':
27
+ return 'amazonaws-us-gov.com'
28
+ if self.partition == 'aws-cn':
29
+ return 'amazonaws.cn'
30
+ return 'aws.amazon.com'
31
+
24
32
  @property
25
33
  def awsIdentity(self) -> dict:
26
34
  if not self._awsIdentity:
@@ -22,8 +22,8 @@
22
22
  "b163ad4b-f459-4b01-b2f3-54a168088640": {
23
23
  "RelationalTable": {
24
24
  "DataSourceArn": "${athena_datasource_arn}",
25
- "Schema": "${athena_database_name}",
26
- "Name": "${cur_table_name}",
25
+ "Schema": "${cur1_database}",
26
+ "Name": "${cur1_table_name}",
27
27
  "InputColumns": [
28
28
  {
29
29
  "Name": "product_updates",
@@ -837,7 +837,7 @@
837
837
  }
838
838
  },
839
839
  "2f69dc70-9487-4f34-9120-e5f40660b257": {
840
- "Alias": "${cur_table_name}",
840
+ "Alias": "${cur1_table_name}",
841
841
  "Source": {
842
842
  "PhysicalTableId": "b163ad4b-f459-4b01-b2f3-54a168088640"
843
843
  }
@@ -1382,6 +1382,17 @@
1382
1382
  ]
1383
1383
  }
1384
1384
  },
1385
+ {
1386
+ "CreateColumnsOperation": {
1387
+ "Columns": [
1388
+ {
1389
+ "ColumnName": "account_id",
1390
+ "ColumnId": "2f67fc2d-9c64-4f14-9d28-f962cad070d9",
1391
+ "Expression": "accountid"
1392
+ }
1393
+ ]
1394
+ }
1395
+ },
1385
1396
  {
1386
1397
  "ProjectOperation": {
1387
1398
  "ProjectedColumns": [
@@ -1389,6 +1400,7 @@
1389
1400
  "checkname",
1390
1401
  "accountparentname",
1391
1402
  "accountid",
1403
+ "account_id",
1392
1404
  "category",
1393
1405
  "checkid",
1394
1406
  "issuppressed",
@@ -1,7 +1,7 @@
1
1
  CREATE OR REPLACE VIEW "compute_savings_plan_eligible_spend" AS
2
2
  SELECT DISTINCT
3
- "year"
4
- , "month"
3
+ split_part("billing_period", '-', 1) "year"
4
+ , split_part("billing_period", '-', 2) "month"
5
5
  , "bill_payer_account_id" "payer_account_id"
6
6
  , "line_item_usage_account_id" "linked_account_id"
7
7
  , "bill_billing_period_start_date" "billing_period"
@@ -16,9 +16,9 @@
16
16
  WHEN ("line_item_usage_type" LIKE '%Fargate%') THEN "line_item_unblended_cost"
17
17
  ELSE 0
18
18
  END
19
- ELSE 0
19
+ ELSE 0
20
20
  END) "unblended_cost"
21
21
  FROM
22
- "${cur_table_name}"
22
+ "${cur2_database}"."${cur2_table_name}"
23
23
  WHERE (("bill_billing_period_start_date" >= ("date_trunc"('month', current_timestamp) - INTERVAL '1' MONTH)) AND ("line_item_usage_start_date" < ("date_trunc"('day', current_timestamp) - INTERVAL '1' DAY)) AND ((("line_item_product_code" = 'AmazonEC2') AND ("line_item_operation" LIKE '%RunInstances%')) OR (("line_item_product_code" = 'AWSLambda') AND ("line_item_usage_type" LIKE '%Lambda-Provisioned-GB-Second%')) OR (("line_item_product_code" = 'AWSLambda') AND ("line_item_usage_type" LIKE '%Lambda-GB-Second%')) OR (("line_item_product_code" = 'AWSLambda') AND ("line_item_usage_type" LIKE '%Lambda-Provisioned-Concurrency%')) OR ("line_item_usage_type" LIKE '%Fargate%')) AND ("line_item_line_item_type" = 'Usage') AND ("line_item_usage_type" NOT LIKE '%Spot%') AND ("product_servicecode" <> 'AWSDataTransfer') AND ("line_item_usage_type" NOT LIKE '%DataXfer%'))
24
24
  GROUP BY 1, 2, 3, 4,5,6
@@ -1,12 +1,17 @@
1
- CREATE OR REPLACE VIEW "ec2_running_cost" AS
1
+ CREATE OR REPLACE VIEW "ec2_running_cost" AS
2
2
  SELECT DISTINCT
3
- "year"
4
- , "month"
3
+ split_part("billing_period", '-', 1) "year"
4
+ , split_part("billing_period", '-', 2) "month"
5
5
  , "bill_billing_period_start_date" "billing_period"
6
6
  , "date_trunc"('hour', "line_item_usage_start_date") "usage_date"
7
7
  , "bill_payer_account_id" "payer_account_id"
8
8
  , "line_item_usage_account_id" "linked_account_id"
9
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN 'SavingsPlan' WHEN ("reservation_reservation_a_r_n" <> '') THEN 'Reserved' WHEN ("line_item_usage_type" LIKE '%Spot%') THEN 'Spot' ELSE 'OnDemand' END) "purchase_option"
9
+ , (CASE
10
+ WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN 'SavingsPlan'
11
+ WHEN ("reservation_reservation_a_r_n" <> '') THEN 'Reserved'
12
+ WHEN ("line_item_usage_type" LIKE '%Spot%') THEN 'Spot'
13
+ ELSE 'OnDemand'
14
+ END) "purchase_option"
10
15
  , "sum"(CASE
11
16
  WHEN "line_item_line_item_type" = 'SavingsPlanCoveredUsage' THEN "savings_plan_savings_plan_effective_cost"
12
17
  WHEN "line_item_line_item_type" = 'DiscountedUsage' THEN "reservation_effective_cost"
@@ -14,6 +19,6 @@
14
19
  ELSE 0 END) "amortized_cost"
15
20
  , "round"("sum"("line_item_usage_amount"), 2) "usage_quantity"
16
21
  FROM
17
- "${cur_table_name}"
22
+ "${cur2_database}"."${cur2_table_name}"
18
23
  WHERE (((((("bill_billing_period_start_date" >= ("date_trunc"('month', current_timestamp) - INTERVAL '1' MONTH)) AND ("line_item_product_code" = 'AmazonEC2')) AND ("product_servicecode" <> 'AWSDataTransfer')) AND ("line_item_operation" LIKE '%RunInstances%')) AND ("line_item_usage_type" NOT LIKE '%DataXfer%')) AND ((("line_item_line_item_type" = 'Usage') OR ("line_item_line_item_type" = 'SavingsPlanCoveredUsage')) OR ("line_item_line_item_type" = 'DiscountedUsage')))
19
24
  GROUP BY 1, 2, 3, 4,5,6,7
@@ -1,4 +1,4 @@
1
- CREATE OR REPLACE VIEW "ri_sp_mapping" AS
1
+ CREATE OR REPLACE VIEW "ri_sp_mapping" AS
2
2
  SELECT DISTINCT
3
3
  "a"."billing_period_mapping"
4
4
  , "a"."payer_account_id_mapping"
@@ -12,13 +12,13 @@ FROM
12
12
  SELECT DISTINCT
13
13
  "bill_billing_period_start_date" "billing_period_mapping"
14
14
  , "bill_payer_account_id" "payer_account_id_mapping"
15
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_savings_plan_a_r_n" WHEN ("reservation_reservation_a_r_n" <> '') THEN "reservation_reservation_a_r_n" ELSE '' END) "ri_sp_arn_mapping"
15
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_savings_plan_a_r_n" WHEN ("reservation_reservation_a_r_n" <> '') THEN "reservation_reservation_a_r_n" ELSE '' END) "ri_sp_arn_mapping"
16
16
  , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN CAST(CAST("from_iso8601_timestamp"("savings_plan_end_time") AS date) AS timestamp) WHEN (("reservation_reservation_a_r_n" <> '') AND ("reservation_end_time" <> '')) THEN CAST(CAST("from_iso8601_timestamp"("reservation_end_time") AS date) AS timestamp) ELSE null END) "ri_sp_end_date"
17
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_purchase_term" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_lease_contract_length" ELSE '' END) "ri_sp_term"
18
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_offering_type" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_offering_class" ELSE '' END) "ri_sp_offering"
19
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_payment_option" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_purchase_option" ELSE '' END) "ri_sp_Payment"
17
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_purchase_term" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_lease_contract_length" ELSE '' END) "ri_sp_term"
18
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_offering_type" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_offering_class" ELSE '' END) "ri_sp_offering"
19
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_payment_option" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_purchase_option" ELSE '' END) "ri_sp_payment"
20
20
  FROM
21
- "${cur_table_name}"
21
+ "${cur2_database}"."${cur2_table_name}"
22
22
  WHERE (("line_item_line_item_type" = 'RIFee') OR ("line_item_line_item_type" = 'SavingsPlanRecurringFee'))
23
23
  ) a
24
24
  LEFT JOIN (
@@ -26,10 +26,10 @@ LEFT JOIN (
26
26
  "bill_billing_period_start_date" "billing_period_mapping"
27
27
  , "bill_payer_account_id" "payer_account_id_mapping"
28
28
  , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_savings_plan_a_r_n" WHEN ("reservation_reservation_a_r_n" <> '') THEN "reservation_reservation_a_r_n" ELSE '' END) "ri_sp_arn_mapping"
29
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_purchase_term" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_lease_contract_length" ELSE '' END) "ri_sp_term"
30
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_offering_type" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_offering_class" ELSE '' END) "ri_sp_offering"
31
- , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_payment_option" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_purchase_option" ELSE '' END) "ri_sp_Payment"
29
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_purchase_term" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_lease_contract_length" ELSE '' END) "ri_sp_term"
30
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_offering_type" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_offering_class" ELSE '' END) "ri_sp_offering"
31
+ , (CASE WHEN ("savings_plan_savings_plan_a_r_n" <> '') THEN "savings_plan_payment_option" WHEN ("reservation_reservation_a_r_n" <> '') THEN "pricing_purchase_option" ELSE '' END) "ri_sp_payment"
32
32
  FROM
33
- "${cur_table_name}"
33
+ "${cur2_database}"."${cur2_table_name}"
34
34
  WHERE (("line_item_line_item_type" = 'DiscountedUsage') OR ("line_item_line_item_type" = 'SavingsPlanCoveredUsage'))
35
35
  ) b ON ((("a"."ri_sp_arn_mapping" = "b"."ri_sp_arn_mapping") AND ("a"."billing_period_mapping" = "b"."billing_period_mapping")) AND ("a"."payer_account_id_mapping" = "b"."payer_account_id_mapping")))
@@ -1,6 +1,7 @@
1
1
  CREATE OR REPLACE VIEW "s3_view" AS
2
- SELECT DISTINCT "year",
3
- "month",
2
+ SELECT DISTINCT
3
+ split_part("billing_period", '-', 1) "year",
4
+ split_part("billing_period", '-', 2) "month",
4
5
  "bill_billing_period_start_date" "billing_period",
5
6
  "date_trunc"('day', "line_item_usage_start_date") "usage_date",
6
7
  "bill_payer_account_id" "payer_account_id",
@@ -8,7 +9,7 @@ SELECT DISTINCT "year",
8
9
  "line_item_resource_id" "resource_id",
9
10
  "line_item_product_code" "product_code",
10
11
  "line_item_operation" "operation",
11
- "product_region" "region",
12
+ product['region'] "region",
12
13
  "line_item_line_item_type" "charge_type",
13
14
  "pricing_unit" "pricing_unit",
14
15
  "sum"(
@@ -19,7 +20,7 @@ SELECT DISTINCT "year",
19
20
  ) "usage_quantity",
20
21
  "sum"("line_item_unblended_cost") "unblended_cost",
21
22
  "sum"("pricing_public_on_demand_cost") "public_cost"
22
- FROM "${cur_table_name}"
23
+ FROM "${cur2_database}"."${cur2_table_name}"
23
24
  WHERE (
24
25
  (
25
26
  (