Skip to content

Commit 574e45d

Browse files
authored
remove print (#1207)
* remove print * change tag naming * fix initial creation * release 4.2.1
1 parent 191d138 commit 574e45d

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

cfn-templates/cid-cfn.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://github.com/aws-samples/aws-cudos-framework-deployment/blob/main/cfn-templates/cid-cfn.yml
22
AWSTemplateFormatVersion: '2010-09-09'
3-
Description: Deployment of Cloud Intelligence Dashboards v4.2.0 - AWS Solution SO9011
3+
Description: Deployment of Cloud Intelligence Dashboards v4.2.1 - AWS Solution SO9011
44
Metadata:
55
AWS::CloudFormation::Interface:
66
ParameterGroups:
@@ -2070,7 +2070,7 @@ Resources:
20702070
SourceBucket: !Ref ReferenceAssetsBucket
20712071
DestinationBucket: !Ref LocalAssetsBucket
20722072
Keys:
2073-
- 'cid-resource-lambda-layer/cid-4.2.0.zip' #replace version here if needed
2073+
- 'cid-resource-lambda-layer/cid-4.2.1.zip' #replace version here if needed
20742074

20752075
CidResourceLambdaLayer:
20762076
Type: AWS::Lambda::LayerVersion
@@ -2085,7 +2085,7 @@ Resources:
20852085
- LambdaLayerBucketPrefixIsManaged
20862086
- !FindInMap [RegionMap, !Ref 'AWS::Region', BucketName]
20872087
- !Sub '${LambdaLayerBucketPrefix}-${AWS::Region}' # Region added for backward compatibility
2088-
S3Key: 'cid-resource-lambda-layer/cid-4.2.0.zip' #replace version here if needed
2088+
S3Key: 'cid-resource-lambda-layer/cid-4.2.1.zip' #replace version here if needed
20892089
CompatibleRuntimes:
20902090
- python3.10
20912091
- python3.11

cid/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '4.2.0'
1+
__version__ = '4.2.1'
22

cid/builtin/core/data/resources.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ datasets:
139139
- DataExports
140140
views:
141141
- ec2_running_cost
142+
- account_map
142143
schedules:
143144
- default
144145
# CID dataset
@@ -149,6 +150,7 @@ datasets:
149150
- DataExports
150151
views:
151152
- compute_savings_plan_eligible_spend
153+
- account_map
152154
schedules:
153155
- default
154156
# CID dataset
@@ -906,8 +908,8 @@ views:
906908
- compute_optimizer_idle_options
907909

908910
# Shared views
909-
#account_map:
910-
# File: queries/shared/account_map.sql
911+
account_map:
912+
File: queries/shared/account_map.sql
911913
business_units_map:
912914
File: queries/shared/business_units_map.sql
913915
aws_accounts:

cid/helpers/quicksight/dashboard_patching.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def format_field_name(field_name: str, ignore_prefix: bool=False) -> str:
3030
assert format_field_name('account_name') == 'Account Name'
3131
assert format_field_name('a_c_r_o_n_y_m') == 'ACRONYM'
3232
assert format_field_name('tag_a_c_r_o_n_y_m') == 'Tag ACRONYM'
33+
assert format_field_name('tag_service') == 'Tag Service'
3334
"""
3435
parts = field_name.split('_')
3536
result = []
@@ -47,11 +48,15 @@ def format_field_name(field_name: str, ignore_prefix: bool=False) -> str:
4748
result.append(parts[i].title())
4849
i += 1
4950
title = ' '.join(result)
51+
title = title.replace('Aws ', 'AWS ')
5052
if ignore_prefix:
53+
new_title = title
5154
if title.startswith('Cost Category '):
52-
title = title.replace('Cost Category ', '')
53-
if title.startswith('Tag '):
54-
title = title.replace('Tag ', '')
55+
new_title = title.replace('Cost Category ', '')
56+
elif title.startswith('Tag '):
57+
new_title = title.replace('Tag ', '')
58+
if title.lower() not in ('service', 'region', 'account'): # leave prefix for special terms
59+
title = new_title
5560
return title
5661

5762
def align_grid_position(elements: List[Dict[str, Any]]) -> None:

cid/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def get_parameter(param_name, message, choices=None, default=None, none_as_disab
305305
).execute()
306306
else: # it is a text entry
307307
if isinstance(default, str) and template_variables:
308-
print(template_variables)
308+
logger.debug(f'template_variables = {template_variables}')
309309
default=default.format(**template_variables)
310310
print()
311311
if not isatty():

0 commit comments

Comments
 (0)