cid-cmd 0.2.45__tar.gz → 0.3.0__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 (131) hide show
  1. {cid-cmd-0.2.45/cid_cmd.egg-info → cid_cmd-0.3.0}/PKG-INFO +24 -12
  2. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/README.md +19 -8
  3. cid_cmd-0.3.0/cid/_version.py +1 -0
  4. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/base.py +6 -0
  5. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/last_kpi_tracker_view.sql +5 -6
  6. cid_cmd-0.3.0/cid/builtin/core/data/queries/shared/cur.yaml +89 -0
  7. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/resources.yaml +59 -4
  8. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/cli.py +37 -6
  9. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/commands/init_qs.py +16 -11
  10. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/common.py +323 -148
  11. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/export.py +88 -23
  12. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/__init__.py +5 -3
  13. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/athena.py +114 -115
  14. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/cur.py +21 -47
  15. cid_cmd-0.3.0/cid/helpers/glue.py +95 -0
  16. cid_cmd-0.3.0/cid/helpers/iam.py +457 -0
  17. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/__init__.py +105 -34
  18. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/dashboard.py +10 -6
  19. cid_cmd-0.3.0/cid/helpers/s3.py +90 -0
  20. cid_cmd-0.3.0/cid/test/python/test_isolated_parameters.py +12 -0
  21. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/utils.py +19 -5
  22. {cid-cmd-0.2.45 → cid_cmd-0.3.0/cid_cmd.egg-info}/PKG-INFO +24 -12
  23. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid_cmd.egg-info/SOURCES.txt +3 -0
  24. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid_cmd.egg-info/requires.txt +2 -1
  25. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/setup.cfg +4 -3
  26. cid-cmd-0.2.45/cid/_version.py +0 -2
  27. cid-cmd-0.2.45/cid/helpers/glue.py +0 -39
  28. cid-cmd-0.2.45/cid/helpers/s3.py +0 -83
  29. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/LICENSE +0 -0
  30. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/MANIFEST.in +0 -0
  31. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/__init__.py +0 -0
  32. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/__init__.py +0 -0
  33. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/__init__.py +0 -0
  34. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cid/compute.json +0 -0
  35. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cid/ec2_running_cost.json +0 -0
  36. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cid/s3_view.json +0 -0
  37. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cid/summary_view.json +0 -0
  38. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/co/dataset.json +0 -0
  39. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cudos/hourly_view.json +0 -0
  40. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/cudos/resource_view.json +0 -0
  41. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/kpi/kpi_ebs_snap.json +0 -0
  42. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/kpi/kpi_ebs_storage_all.json +0 -0
  43. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/kpi/kpi_instance_all.json +0 -0
  44. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/kpi/kpi_s3_storage_all.json +0 -0
  45. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/kpi/kpi_tracker.json +0 -0
  46. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/shared/customer_all.json +0 -0
  47. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/tao/dataset.json +0 -0
  48. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/trends/daily_anomaly_detection.json +0 -0
  49. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/trends/monthly_anomaly_detection.json +0 -0
  50. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/datasets/trends/monthly_bill_by_account.json +0 -0
  51. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/permissions/dashboard_permissions.json +0 -0
  52. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/permissions/dashboard_permissions_namespace.json +0 -0
  53. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/permissions/data_set_permissions.json +0 -0
  54. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/permissions/data_source_permissions.json +0 -0
  55. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/permissions/folder_permissions.json +0 -0
  56. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/compute_savings_plan_eligible_spend.sql +0 -0
  57. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ec2_running_cost.sql +0 -0
  58. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ec2_running_cost_ri.sql +0 -0
  59. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ec2_running_cost_sp.sql +0 -0
  60. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ec2_running_cost_sp_ri.sql +0 -0
  61. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ri_sp_mapping.sql +0 -0
  62. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ri_sp_mapping_ri.sql +0 -0
  63. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ri_sp_mapping_sp.sql +0 -0
  64. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/ri_sp_mapping_sp_ri.sql +0 -0
  65. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/s3.sql +0 -0
  66. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/summary_view.sql +0 -0
  67. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/summary_view_ri.sql +0 -0
  68. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/summary_view_sp.sql +0 -0
  69. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cid/summary_view_sp_ri.sql +0 -0
  70. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/all_options.sql +0 -0
  71. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/auto_scale.json +0 -0
  72. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/auto_scale_options.sql +0 -0
  73. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/ebs_volume.json +0 -0
  74. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/ebs_volume_options.sql +0 -0
  75. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/ec2_instance.json +0 -0
  76. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/ec2_instance_options.sql +0 -0
  77. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/lambda.json +0 -0
  78. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/co/lambda_options.sql +0 -0
  79. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/hourly_view.sql +0 -0
  80. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/hourly_view_ri.sql +0 -0
  81. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/hourly_view_sp.sql +0 -0
  82. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/hourly_view_sp_ri.sql +0 -0
  83. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/resource_view.sql +0 -0
  84. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/resource_view_ri.sql +0 -0
  85. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/resource_view_sp.sql +0 -0
  86. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/cudos/resource_view_sp_ri.sql +0 -0
  87. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/first_kpi_instance_mapping_view.sql +0 -0
  88. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_ebs_snap_view.sql +0 -0
  89. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_ebs_storage_view.sql +0 -0
  90. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_instance_all_view.sql +0 -0
  91. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noRI.sql +0 -0
  92. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noRISP.sql +0 -0
  93. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_instance_all_view_noSP.sql +0 -0
  94. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/kpi/kpi_s3_storage_view.sql +0 -0
  95. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/account_map.sql +0 -0
  96. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/account_map_dummy.sql +0 -0
  97. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/aws_accounts.sql +0 -0
  98. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/aws_regions.sql +0 -0
  99. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/aws_service_category_map.sql +0 -0
  100. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/business_units_map.sql +0 -0
  101. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/payer_account_name_map.sql +0 -0
  102. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/shared/ta_descriptions.sql +0 -0
  103. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/tao/glue_table.json +0 -0
  104. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/tao/ta_org_view.sql +0 -0
  105. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/daily_anomaly_detection.sql +0 -0
  106. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/monthly_anomaly_detection.sql +0 -0
  107. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/monthly_bill_by_account.sql +0 -0
  108. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/monthly_bill_by_account_ri.sql +0 -0
  109. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/monthly_bill_by_account_sp.sql +0 -0
  110. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/builtin/core/data/queries/trends/monthly_bill_by_account_sp_ri.sql +0 -0
  111. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/commands/__init__.py +0 -0
  112. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/commands/command_base.py +0 -0
  113. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/exceptions.py +0 -0
  114. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/account_map.py +0 -0
  115. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/csv2view.py +0 -0
  116. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/diff.py +0 -0
  117. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/organizations.py +0 -0
  118. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/dataset.py +0 -0
  119. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/datasource.py +0 -0
  120. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/resource.py +0 -0
  121. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/quicksight/template.py +0 -0
  122. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/randtime.py +0 -0
  123. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/helpers/timezone.py +0 -0
  124. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/logger.py +0 -0
  125. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/plugin.py +0 -0
  126. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/test/python/test_csv2view.py +0 -0
  127. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid/test/python/test_merge.py +0 -0
  128. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid_cmd.egg-info/dependency_links.txt +0 -0
  129. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid_cmd.egg-info/entry_points.txt +0 -0
  130. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/cid_cmd.egg-info/top_level.txt +0 -0
  131. {cid-cmd-0.2.45 → cid_cmd-0.3.0}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cid-cmd
3
- Version: 0.2.45
3
+ Version: 0.3.0
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.34.70
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
 
@@ -70,7 +71,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
70
71
 
71
72
  Automation requires Python 3
72
73
 
73
- 2. Make sure you have latest pip package installed
74
+ 2. Make sure you have the latest pip package installed
74
75
  ```bash
75
76
  python3 -m ensurepip --upgrade
76
77
  ```
@@ -92,16 +93,20 @@ Update only Dashboard
92
93
  ```bash
93
94
  cid-cmd update
94
95
  ```
95
- Update dashboard and all dependenies (Datasets and Athena View). WARNING: this will overide any customization of SQL files and Datasets.
96
+ Update dashboard and all dependencies (Datasets and Athena View). WARNING: this will override any customization of SQL files and Datasets.
96
97
  ```bash
97
98
  cid-cmd update --force --recursive
98
99
  ```
99
- #### Show Dashboard status
100
+ #### Show Dashboard Status
100
101
  Show dashboards status
101
102
 
102
103
  ```bash
103
104
  cid-cmd status
104
105
  ```
106
+ [<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)
107
+
108
+
109
+
105
110
 
106
111
  #### Share QuickSight resources
107
112
  ```bash
@@ -109,21 +114,28 @@ 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
116
121
  ```
117
122
 
123
+ #### Initialize CUR
124
+ One time action to initialize Athena table and Crawler from s3 with CUR data.
125
+
126
+ ```bash
127
+ cid-cmd init-cur
128
+ ```
118
129
 
119
130
  #### Delete Dashboard and all dependencies unused by other
120
131
  Delete Dashboards and all dependencies unused by other CID-managed dashboards.(including QuickSight datasets, Athena views and tables)
121
132
  ```bash
122
133
  cid-cmd delete
123
134
  ```
135
+
124
136
  #### Delete Command Options:
125
137
  ```
126
- --dashboard-id TEXT QuickSight dashboard id
138
+ --dashboard-id TEXT QuickSight dashboard id
127
139
  --athena-database TEXT Athena database
128
140
  ```
129
141
 
@@ -155,10 +167,10 @@ This command generates a SQL file that you can execute. Please mind [Athena Serv
155
167
 
156
168
 
157
169
  ## 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.
170
+ 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
171
 
160
172
  ## Terraform
161
- CID offers a set of Terraform modules to deploy CUR replicaion and CID dashboards. These modules act as a wrapper around CloudFormation.
173
+ CID offers a set of Terraform modules to deploy CUR replication and CID dashboards. These modules act as a wrapper around CloudFormation.
162
174
 
163
175
  1. Create a bucket for consolidating CUR [terraform-modules/cur-setup-destination/](terraform-modules/cur-setup-destination/)
164
176
  2. Create a CUR in Payer Account(s) [terraform-modules/cur-setup-source/](terraform-modules/cur-setup-source/)
@@ -44,7 +44,7 @@ See more dashboards on the [workshop page](https://catalog.workshops.aws/awscid/
44
44
 
45
45
  Automation requires Python 3
46
46
 
47
- 2. Make sure you have latest pip package installed
47
+ 2. Make sure you have the latest pip package installed
48
48
  ```bash
49
49
  python3 -m ensurepip --upgrade
50
50
  ```
@@ -66,16 +66,20 @@ Update only Dashboard
66
66
  ```bash
67
67
  cid-cmd update
68
68
  ```
69
- Update dashboard and all dependenies (Datasets and Athena View). WARNING: this will overide any customization of SQL files and Datasets.
69
+ Update dashboard and all dependencies (Datasets and Athena View). WARNING: this will override any customization of SQL files and Datasets.
70
70
  ```bash
71
71
  cid-cmd update --force --recursive
72
72
  ```
73
- #### Show Dashboard status
73
+ #### Show Dashboard Status
74
74
  Show dashboards status
75
75
 
76
76
  ```bash
77
77
  cid-cmd status
78
78
  ```
79
+ [<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)
80
+
81
+
82
+
79
83
 
80
84
  #### Share QuickSight resources
81
85
  ```bash
@@ -83,21 +87,28 @@ 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
90
94
  ```
91
95
 
96
+ #### Initialize CUR
97
+ One time action to initialize Athena table and Crawler from s3 with CUR data.
98
+
99
+ ```bash
100
+ cid-cmd init-cur
101
+ ```
92
102
 
93
103
  #### Delete Dashboard and all dependencies unused by other
94
104
  Delete Dashboards and all dependencies unused by other CID-managed dashboards.(including QuickSight datasets, Athena views and tables)
95
105
  ```bash
96
106
  cid-cmd delete
97
107
  ```
108
+
98
109
  #### Delete Command Options:
99
110
  ```
100
- --dashboard-id TEXT QuickSight dashboard id
111
+ --dashboard-id TEXT QuickSight dashboard id
101
112
  --athena-database TEXT Athena database
102
113
  ```
103
114
 
@@ -129,10 +140,10 @@ This command generates a SQL file that you can execute. Please mind [Athena Serv
129
140
 
130
141
 
131
142
  ## 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.
143
+ 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
144
 
134
145
  ## Terraform
135
- CID offers a set of Terraform modules to deploy CUR replicaion and CID dashboards. These modules act as a wrapper around CloudFormation.
146
+ CID offers a set of Terraform modules to deploy CUR replication and CID dashboards. These modules act as a wrapper around CloudFormation.
136
147
 
137
148
  1. Create a bucket for consolidating CUR [terraform-modules/cur-setup-destination/](terraform-modules/cur-setup-destination/)
138
149
  2. Create a CUR in Payer Account(s) [terraform-modules/cur-setup-source/](terraform-modules/cur-setup-source/)
@@ -0,0 +1 @@
1
+ __version__ = '0.3.0'
@@ -21,6 +21,12 @@ 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.region.startswith('cn-'):
27
+ return 'amazonaws.cn'
28
+ return 'aws.amazon.com'
29
+
24
30
  @property
25
31
  def awsIdentity(self) -> dict:
26
32
  if not self._awsIdentity:
@@ -1,4 +1,3 @@
1
-
2
1
  CREATE OR REPLACE VIEW kpi_tracker AS
3
2
  SELECT DISTINCT
4
3
  spend_all.billing_period
@@ -87,7 +86,7 @@ LEFT JOIN (
87
86
  summary_view
88
87
  WHERE (CAST("concat"("year", '-', "month", '-01') AS date) >= ("date_trunc"('month', current_date) - INTERVAL '3' MONTH))
89
88
  GROUP BY 1, 2, 3
90
- ) spend_all ON (spend_all.linked_account_id = account_id))
89
+ ) spend_all ON (spend_all.linked_account_id = account_id) AND (spend_all.payer_account_id = payer_account_id))
91
90
  LEFT JOIN (
92
91
  SELECT DISTINCT
93
92
  billing_period
@@ -153,7 +152,7 @@ LEFT JOIN (
153
152
  FROM
154
153
  kpi_instance_all
155
154
  GROUP BY 1, 2, 3
156
- ) instance_all ON ((instance_all.linked_account_id = account_id) AND (instance_all.billing_period = spend_all.billing_period)))
155
+ ) instance_all ON ((instance_all.linked_account_id = account_id) AND (instance_all.billing_period = spend_all.billing_period) AND (instance_all.payer_account_id = spend_all.payer_account_id)))
157
156
  LEFT JOIN (
158
157
  SELECT DISTINCT
159
158
  billing_period
@@ -167,7 +166,7 @@ LEFT JOIN (
167
166
  FROM
168
167
  kpi_ebs_storage_all
169
168
  GROUP BY 1, 2, 3
170
- ) ebs_all ON ((ebs_all.linked_account_id = account_id) AND (ebs_all.billing_period = spend_all.billing_period)))
169
+ ) ebs_all ON ((ebs_all.linked_account_id = account_id) AND (ebs_all.billing_period = spend_all.billing_period) AND (ebs_all.payer_account_id = spend_all.payer_account_id)))
171
170
  LEFT JOIN (
172
171
  SELECT DISTINCT
173
172
  billing_period
@@ -179,7 +178,7 @@ LEFT JOIN (
179
178
  FROM
180
179
  kpi_ebs_snap
181
180
  GROUP BY 1, 2, 3
182
- ) snap ON ((snap.linked_account_id = account_id) AND (snap.billing_period = spend_all.billing_period)))
181
+ ) snap ON ((snap.linked_account_id = account_id) AND (snap.billing_period = spend_all.billing_period) AND (snap.payer_account_id = spend_all.payer_account_id)))
183
182
  LEFT JOIN (
184
183
  SELECT DISTINCT
185
184
  billing_period
@@ -191,5 +190,5 @@ LEFT JOIN (
191
190
  FROM
192
191
  kpi_s3_storage_all
193
192
  GROUP BY 1, 2, 3
194
- ) s3_all ON ((s3_all.linked_account_id = account_id) AND (s3_all.billing_period = spend_all.billing_period)))
193
+ ) s3_all ON ((s3_all.linked_account_id = account_id) AND (s3_all.billing_period = spend_all.billing_period) AND (s3_all.payer_account_id = spend_all.payer_account_id)))
195
194
  WHERE (spend_all.billing_period >= ("date_trunc"('month', current_timestamp) - INTERVAL '3' MONTH))
@@ -0,0 +1,89 @@
1
+ DatabaseName: "${athena_database_name}"
2
+ TableInput:
3
+ Name: "${athenaTableName}"
4
+ Owner: owner
5
+ Retention: 0
6
+ TableType: EXTERNAL_TABLE
7
+ Parameters:
8
+ compressionType: none
9
+ classification: parquet
10
+ UPDATED_BY_CRAWLER: CidCurCrawler # Hard coded Crawler Name
11
+ StorageDescriptor:
12
+ BucketColumns: []
13
+ Compressed: false
14
+ Location: "${location}"
15
+ NumberOfBuckets: -1
16
+ InputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
17
+ OutputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
18
+ SerdeInfo:
19
+ Parameters:
20
+ serialization.format: '1'
21
+ SerializationLibrary: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
22
+ StoredAsSubDirectories: false
23
+ Columns: # All fields required for CID
24
+ - {"Name": "bill_bill_type", "Type": "string" }
25
+ - {"Name": "bill_billing_entity", "Type": "string" }
26
+ - {"Name": "bill_billing_period_end_date", "Type": "timestamp" }
27
+ - {"Name": "bill_billing_period_start_date", "Type": "timestamp" }
28
+ - {"Name": "bill_invoice_id", "Type": "string" }
29
+ - {"Name": "bill_payer_account_id", "Type": "string" }
30
+ - {"Name": "identity_line_item_id", "Type": "string" }
31
+ - {"Name": "identity_time_interval", "Type": "string" }
32
+ - {"Name": "line_item_availability_zone", "Type": "string" }
33
+ - {"Name": "line_item_legal_entity", "Type": "string" }
34
+ - {"Name": "line_item_line_item_description", "Type": "string" }
35
+ - {"Name": "line_item_line_item_type", "Type": "string" }
36
+ - {"Name": "line_item_operation", "Type": "string" }
37
+ - {"Name": "line_item_product_code", "Type": "string" }
38
+ - {"Name": "line_item_resource_id", "Type": "string" }
39
+ - {"Name": "line_item_unblended_cost", "Type": "double" }
40
+ - {"Name": "line_item_usage_account_id", "Type": "string" }
41
+ - {"Name": "line_item_usage_amount", "Type": "double" }
42
+ - {"Name": "line_item_usage_end_date", "Type": "timestamp" }
43
+ - {"Name": "line_item_usage_start_date", "Type": "timestamp" }
44
+ - {"Name": "line_item_usage_type", "Type": "string" }
45
+ - {"Name": "pricing_lease_contract_length", "Type": "string" }
46
+ - {"Name": "pricing_offering_class", "Type": "string" }
47
+ - {"Name": "pricing_public_on_demand_cost", "Type": "double" }
48
+ - {"Name": "pricing_purchase_option", "Type": "string" }
49
+ - {"Name": "pricing_term", "Type": "string" }
50
+ - {"Name": "pricing_unit", "Type": "string" }
51
+ - {"Name": "product_cache_engine", "Type": "string" }
52
+ - {"Name": "product_current_generation", "Type": "string" }
53
+ - {"Name": "product_database_engine", "Type": "string" }
54
+ - {"Name": "product_deployment_option", "Type": "string" }
55
+ - {"Name": "product_from_location", "Type": "string" }
56
+ - {"Name": "product_group", "Type": "string" }
57
+ - {"Name": "product_instance_type", "Type": "string" }
58
+ - {"Name": "product_instance_type_family", "Type": "string" }
59
+ - {"Name": "product_license_model", "Type": "string" }
60
+ - {"Name": "product_operating_system", "Type": "string" }
61
+ - {"Name": "product_physical_processor", "Type": "string" }
62
+ - {"Name": "product_processor_features", "Type": "string" }
63
+ - {"Name": "product_product_family", "Type": "string" }
64
+ - {"Name": "product_product_name", "Type": "string" }
65
+ - {"Name": "product_region", "Type": "string" }
66
+ - {"Name": "product_servicecode", "Type": "string" }
67
+ - {"Name": "product_storage", "Type": "string" }
68
+ - {"Name": "product_tenancy", "Type": "string" }
69
+ - {"Name": "product_to_location", "Type": "string" }
70
+ - {"Name": "product_volume_api_name", "Type": "string" }
71
+ - {"Name": "product_volume_type", "Type": "string" }
72
+ - {"Name": "reservation_amortized_upfront_fee_for_billing_period", "Type": "double" }
73
+ - {"Name": "reservation_effective_cost", "Type": "double" }
74
+ - {"Name": "reservation_end_time", "Type": "string" }
75
+ - {"Name": "reservation_reservation_a_r_n", "Type": "string" }
76
+ - {"Name": "reservation_start_time", "Type": "string" }
77
+ - {"Name": "reservation_unused_amortized_upfront_fee_for_billing_period", "Type": "double" }
78
+ - {"Name": "reservation_unused_recurring_fee", "Type": "double" }
79
+ - {"Name": "savings_plan_amortized_upfront_commitment_for_billing_period", "Type": "double" }
80
+ - {"Name": "savings_plan_end_time", "Type": "string" }
81
+ - {"Name": "savings_plan_offering_type", "Type": "string" }
82
+ - {"Name": "savings_plan_payment_option", "Type": "string" }
83
+ - {"Name": "savings_plan_purchase_term", "Type": "string" }
84
+ - {"Name": "savings_plan_savings_plan_a_r_n", "Type": "string" }
85
+ - {"Name": "savings_plan_savings_plan_effective_cost", "Type": "double" }
86
+ - {"Name": "savings_plan_start_time", "Type": "string" }
87
+ - {"Name": "savings_plan_total_commitment_to_date", "Type": "double" }
88
+ - {"Name": "savings_plan_used_commitment", "Type": "double" }
89
+ PartitionKeys: ${partitions} # can be a list
@@ -542,7 +542,7 @@ views:
542
542
  File: co/ec2_instance.json
543
543
  parameters:
544
544
  s3FolderPath:
545
- default: 's3://costoptimizationdata{account_id}/compute_optimizer/compute_optimizer_ec2_instance'
545
+ default: 's3://cid-data-{account_id}/compute_optimizer/compute_optimizer_ec2_instance'
546
546
  description: Compute Optimiser EC2 report S3 path
547
547
 
548
548
  compute_optimizer_auto_scale_lines:
@@ -550,7 +550,7 @@ views:
550
550
  File: co/auto_scale.json
551
551
  parameters:
552
552
  s3FolderPath:
553
- default: 's3://costoptimizationdata{account_id}/compute_optimizer/compute_optimizer_auto_scale'
553
+ default: 's3://cid-data-{account_id}/compute_optimizer/compute_optimizer_auto_scale'
554
554
  description: Compute Optimiser auto_scale report S3 path
555
555
 
556
556
  compute_optimizer_ebs_volume_lines:
@@ -558,7 +558,7 @@ views:
558
558
  File: co/ebs_volume.json
559
559
  parameters:
560
560
  s3FolderPath:
561
- default: 's3://costoptimizationdata{account_id}/compute_optimizer/compute_optimizer_ebs_volume'
561
+ default: 's3://cid-data-{account_id}/compute_optimizer/compute_optimizer_ebs_volume'
562
562
  description: Compute Optimiser EBS report S3 path
563
563
 
564
564
  compute_optimizer_lambda_lines:
@@ -566,7 +566,7 @@ views:
566
566
  File: co/lambda.json
567
567
  parameters:
568
568
  s3FolderPath:
569
- default: 's3://costoptimizationdata{account_id}/compute_optimizer/compute_optimizer_lambda'
569
+ default: 's3://cid-data-{account_id}/compute_optimizer/compute_optimizer_lambda'
570
570
  description: Compute Optimiser Lambda report S3 path
571
571
 
572
572
  compute_optimizer_ec2_instance_options:
@@ -623,6 +623,19 @@ views:
623
623
  - aws_accounts
624
624
  ta_descriptions:
625
625
  File: shared/ta_descriptions.sql
626
+ cur:
627
+ type: Glue_Table
628
+ File: shared/cur.yaml
629
+ crawler: cur
630
+ parameters:
631
+ partitions:
632
+ type: cur.partitions
633
+ description: 'comma separated list of CUR partitions ex: ["source_account_id","cur_name_1","cur_name_2","year","month"] ex2: ["year","month"]'
634
+ default: '[{"Name":"source_account_id","Type":"string"},{"Name":"cur_name_1","Type":"string"},{"Name":"cur_name_2","Type":"string"},{"Name":"year","Type":"string"},{"Name":"month","Type":"string"}]'
635
+ location:
636
+ type: cur.location
637
+ description: 's3 path'
638
+ default: 's3://cid-{account_id}-shared/cur/'
626
639
 
627
640
  # Refresh Schedules for QuickSight DataSets
628
641
  schedules:
@@ -632,3 +645,45 @@ schedules:
632
645
  Interval: DAILY
633
646
  TimeOfTheDay: '02:00-05:00'
634
647
  RefreshType: FULL_REFRESH
648
+
649
+ crawlers:
650
+ cur:
651
+ data:
652
+ Name: 'CidCmdCurCrawler'
653
+ Description: A recurring crawler that keeps your CUR table in Athena up-to-date.
654
+ Role: ${crawler_role_arn}
655
+ DatabaseName: "${athena_database_name}"
656
+ Targets:
657
+ S3Targets:
658
+ - Path: ${location}
659
+ Exclusions:
660
+ - '**.json'
661
+ - '**.yml'
662
+ - '**.sql'
663
+ - '**.csv'
664
+ - '**.csv.metadata'
665
+ - '**.gz'
666
+ - '**.zip'
667
+ - '**/cost_and_usage_data_status/*'
668
+ - 'aws-programmatic-access-test-object'
669
+ SchemaChangePolicy:
670
+ DeleteBehavior: LOG
671
+ RecrawlPolicy:
672
+ RecrawlBehavior: CRAWL_EVERYTHING
673
+ Schedule: cron(0 2 * * ? *)
674
+ Configuration: |
675
+ {
676
+ "Version":1.0,
677
+ "Grouping": {
678
+ "TableGroupingPolicy": "CombineCompatibleSchemas"
679
+ },
680
+ "CrawlerOutput":{
681
+ "Tables":{
682
+ "AddOrUpdateBehavior":"MergeNewColumns"
683
+ }
684
+ }
685
+ }
686
+ parameters:
687
+ s3path:
688
+ default: 's3://cid-{account_id}-cur/cur/'
689
+ description: CUR path
@@ -1,4 +1,6 @@
1
+ import os
1
2
  import logging
3
+ import platform
2
4
 
3
5
  import click
4
6
 
@@ -14,7 +16,6 @@ prog_name="CLOUD INTELLIGENCE DASHBOARDS (CID) CLI"
14
16
  print(f'{prog_name} {version}\n')
15
17
 
16
18
  if __version__ != latest_version and latest_version != 'UNDEFINED':
17
-
18
19
  print('\033[93mUPDATE AVAILABLE\033[0m')
19
20
  print(f'\033[93mA new version {latest_version} is available, please consider update cid-cmd package via pip\033[0m\n\n')
20
21
  logger.info(f'A new version {latest_version} is available, please consider update cid-cmd package via pip')
@@ -67,6 +68,11 @@ def cid_command(func):
67
68
  @click.option('-y', '--yes', help='confirm all', is_flag=True, default=False)
68
69
  @click.pass_context
69
70
  def main(ctx, **kwargs):
71
+
72
+ # enable color for windows terminal
73
+ if platform.system() == "Windows":
74
+ os.system('color') #nosec B605, B607
75
+
70
76
  ctx.obj = Cid(**kwargs)
71
77
 
72
78
 
@@ -227,23 +233,48 @@ def cleanup(ctx, **kwargs):
227
233
  @cid_command
228
234
  def share(ctx, dashboard_id, **kwargs):
229
235
  """Share QuickSight resources (Dashboard, Datasets, DataSource)"""
230
-
231
236
  ctx.obj.share(dashboard_id)
232
237
 
233
238
  @click.option('-v', '--verbose', count=True)
234
239
  @click.option('-y', '--yes', help='confirm all', is_flag=True, default=False)
235
240
  @cid_command
236
- def initqs(ctx, **kwargs):
241
+ def init_qs(ctx, **kwargs):
237
242
  """Initialize Amazon QuickSight
238
243
 
239
244
  \b
240
-
241
245
  --enable-quicksight-enterprise (yes|no) Confirm the activation of QuickSight
242
- --account-name NAME Unique QuickSight account name (Unique across all AWS users)
246
+ --account-name NAME Unique QuickSight account name (Unique across all AWS users)
243
247
  --notification-email EMAIL User's email for QuickSight notifications
244
248
  """
245
249
 
246
- ctx.obj.initqs(**kwargs)
250
+ ctx.obj.init_qs(**kwargs)
251
+
252
+ @click.option('-v', '--verbose', count=True)
253
+ @cid_command
254
+ def create_cur_table(ctx, **kwargs):
255
+ """Initialize CUR table
256
+
257
+ \b
258
+ --view-cur-location s3://BUCKET/PATH S3 path with CUR data. We support only 2 types of CUR path: 's3://{bucket}/cur' and 's3://{bucket}/{prefix}/{cur_name}/{cur_name}'
259
+ --crawler-role ROLE Name or ARN of crawler role
260
+ """
261
+
262
+ ctx.obj.create_cur_table(**kwargs)
263
+
264
+ @click.option('-v', '--verbose', count=True)
265
+ @click.option('-y', '--yes', help='confirm all', is_flag=True, default=False)
266
+ @cid_command
267
+ def teardown(ctx, **kwargs):
268
+ """Delete all CID assets
269
+
270
+ \b
271
+
272
+ THIS IS VERY DANGEROUS. DO NOT USE IT.
273
+ """
274
+
275
+ ctx.obj.teardown(**kwargs)
247
276
 
248
277
  if __name__ == '__main__':
249
278
  main()
279
+
280
+
@@ -1,5 +1,6 @@
1
1
  """ Command Init QuickSight
2
2
  """
3
+ import re
3
4
  import time
4
5
  import logging
5
6
 
@@ -24,27 +25,27 @@ class InitQsCommand(Command): # pylint: disable=too-few-public-methods
24
25
  self.cid = cid
25
26
 
26
27
  def execute(self, *args, **kwargs):
27
- """Execute the initilization"""
28
+ """Execute the initialization"""
28
29
  self._create_quicksight_enterprise_subscription()
29
30
 
30
31
  def _create_quicksight_enterprise_subscription(self):
31
32
  """Enable QuickSight Enterprise if not enabled already"""
32
- cid_print('Analysing QuickSight Status')
33
+ cid_print('Analyzing QuickSight Status')
33
34
  if self.cid.qs.edition(fresh=True) in ('ENTERPRISE', 'ENTERPRISE_AND_Q'):
34
35
  cid_print(f'QuickSight Edition is {self.cid.qs.edition()}')
35
36
  return
36
37
 
37
38
  cid_print(
38
- '<BOLD><RED>IMPORTANT<END>: <BOLD>Amazion QuickSight Enterprise Edition is required for Cost Intelligence Dashboard. '
39
- 'This will lead to costs in your AWS account (https://aws.amazon.com/quicksight/pricing/).<END>'
39
+ '<BOLD><RED>IMPORTANT<END>: <BOLD>Amazon QuickSight Enterprise Edition is required for Cloud Intelligence Dashboards. '
40
+ 'Enabling Amazon QuickSight Enterprise Edition will incur associated service charges. Make sure you aware about them following QuickSight pricing page (https://aws.amazon.com/quicksight/pricing/) and acknowledge by confirming enabling it. Alternatively you can enable QuickSight Enterprise Edition in the AWS console (https://docs.aws.amazon.com/quicksight/latest/user/signing-up.html) and run this command again.<END>'
40
41
  )
41
42
 
42
43
  if not self.cid.all_yes and not get_yesno_parameter(
43
44
  param_name='enable-quicksight-enterprise',
44
- message='Please, confirm enabling of Amazion QuickSight Enterprise',
45
+ message='Please, confirm enabling of Amazon QuickSight Enterprise',
45
46
  default='no'
46
47
  ):
47
- cid_print('\tInitalization cancelled')
48
+ cid_print('\tInitialization cancelled')
48
49
  return
49
50
 
50
51
  for counter in range(MAX_ITERATIONS):
@@ -57,6 +58,7 @@ class InitQsCommand(Command): # pylint: disable=too-few-public-methods
57
58
  'AccountName': account_name,
58
59
  'NotificationEmail': email,
59
60
  }
61
+ cid_print('Initializing Amazon QuickSight in your AWS Account')
60
62
  try:
61
63
  response = self.cid.qs.client.create_account_subscription(**params)
62
64
  logger.debug(f'create_account_subscription resp: {response}')
@@ -74,16 +76,19 @@ class InitQsCommand(Command): # pylint: disable=too-few-public-methods
74
76
  cid_print(f'\tQuickSight Edition is {self.cid.qs.edition()}.')
75
77
 
76
78
  def _get_account_name_for_quicksight(self):
77
- """Get the account name for quicksight"""
79
+ """Get the account name for quicksight"""
78
80
  for _ in range(MAX_ITERATIONS):
81
+ cid_print('Please, choose a descriptive name for your QuickSight account.')
82
+ cid_print('This will be used later to share it with your users. For test you can use AWS Account Id. This can NOT be changed later. If you are planning to use IdC stop now and create QuickSight Account in UI.')
79
83
  account_name = get_parameter(
80
84
  'account-name',
81
- message=(
82
- '\n\tPlease, choose a descriptive name for your QuickSight account. '
83
- 'This will be used later to share it with your users. This can NOT be changed later.'
84
- ),
85
+ message='Please enter a unique name [A-Za-z0-9-]',
85
86
  default=self.cid.organizations.get_account_name()
86
87
  )
88
+ if not re.match('[A-Za-z0-9-]', account_name):
89
+ logger.error('account_name must match [A-Za-z0-9-]')
90
+ unset_parameter('account-name')
91
+ continue
87
92
  if account_name:
88
93
  return account_name
89
94
  print('\t The account name must not be empty. Please, try again.')