Skip to content

Commit

Permalink
cfn changes for cudos v5 (#662)
Browse files Browse the repository at this point in the history
* cfn changes for cudos v5
  • Loading branch information
yprikhodko authored Nov 10, 2023
1 parent 6687e15 commit 4423859
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions cfn-templates/cid-cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Metadata:
default: CUDOS, Cost-Intelligence-Dashboard and KPI-Dashboard. Require deployment of CUR via CloudFormation (cur-aggregation.yaml) or manually (Dashboard data will appear within 24h after CUR creation).
Parameters:
- CURBucketPath
- DeployCUDOSDashboard
- DeployCUDOSv5
- DeployCostIntelligenceDashboard
- DeployKPIDashboard
- Label:
Expand All @@ -38,6 +38,7 @@ Metadata:
- QuickSightDataSourceRoleName
- QuickSightDataSetRefreshSchedule
- LambdaLayerBucketPrefix
- DeployCUDOSDashboard
- DataBucketsKmsKeyArns
ParameterLabels:
PrerequisitesQuickSight:
Expand All @@ -51,7 +52,9 @@ Metadata:
CURBucketPath:
default: "Path to Cost and Usage report"
DeployCUDOSDashboard:
default: "Deploy CUDOS Dashboard"
default: "CUDOS Dashboard v4 - Deprecated [set 'no' to delete]"
DeployCUDOSv5:
default: "Deploy CUDOS v5 Dashboard"
DeployCostIntelligenceDashboard:
default: "Deploy CostIntelligenceDashboard"
DeployKPIDashboard:
Expand Down Expand Up @@ -151,9 +154,14 @@ Parameters:
Default: ""
DeployCUDOSDashboard:
Type: String
Description: Deploy CUDOS Dashboard
Description: Set to 'no' to remove deprecated (v4) version of CUDOS Dashboard
Default: "no"
AllowedValues: ["yes", "no"]
DeployCUDOSv5:
Type: String
Description: Deploy CUDOS v5 Dashboard
Default: "no"
AllowedValues: ["yes", "no"]
DeployCostIntelligenceDashboard:
Type: String
Description: Deploy Cost Intelligence Dashboard
Expand Down Expand Up @@ -211,13 +219,15 @@ Parameters:

Conditions:
NeedCUDOSDashboard: !Equals [ !Ref DeployCUDOSDashboard, "yes" ]
NeedCUDOSv5: !Equals [ !Ref DeployCUDOSv5, "yes" ]
NeedCostIntelligenceDashboard: !Equals [ !Ref DeployCostIntelligenceDashboard, "yes" ]
NeedKPIDashboard: !Equals [ !Ref DeployKPIDashboard, "yes" ]
NeedTAODashboard: !Equals [ !Ref DeployTAODashboard, "yes" ]
NeedComputeOptimizerDashboard: !Equals [ !Ref DeployComputeOptimizerDashboard, "yes" ]
NeedCUR:
Fn::Or:
- !Equals [ !Ref DeployCUDOSDashboard, "yes" ]
- !Equals [ !Ref DeployCUDOSv5, "yes" ]
- !Equals [ !Ref DeployCostIntelligenceDashboard, "yes" ]
- !Equals [ !Ref DeployKPIDashboard, "yes" ]
NeedDataCollectionLab:
Expand Down Expand Up @@ -248,6 +258,7 @@ Conditions:
- !Equals [ !Ref LakeFormationEnabled, "yes" ]
- Fn::Or:
- !Equals [ !Ref DeployCUDOSDashboard, "yes" ]
- !Equals [ !Ref DeployCUDOSv5, "yes" ]
- !Equals [ !Ref DeployCostIntelligenceDashboard, "yes" ]
- !Equals [ !Ref DeployKPIDashboard, "yes" ]
NeedLakeFormationCrawlerPermissions:
Expand Down Expand Up @@ -1511,7 +1522,28 @@ Resources:
Tags: # Hacky way to manage conditional dependencies
- Key: IgnoreNeedCostIntelligenceDashboard
Value: !If [NeedCostIntelligenceDashboard, !Ref CostIntelligenceDashboard, '']

CUDOSv5Dashboard:
Type: Custom::CidDashboard
Condition: NeedCUDOSv5
DependsOn:
- InitialSetup
Properties:
Name: !Sub 'CUDOSv5Dashboard${Suffix}'
ServiceToken: !GetAtt CidExec.Arn
Dashboard:
dashboard-id: cudos-v5
athena-workgroup: !If [ NeedAthenaWorkgroup, !Ref MyAthenaWorkGroup, !Ref AthenaWorkgroup ]
quicksight-datasource-id: !If [ NeedDatasource, !Select [ 1, !Split [ '/', !GetAtt CidAthenaDataSource.Arn]], 'CID-Athena-1']
quicksight-datasource-role-arn: !If [ NeedQuickSightDataSourceRole, !Sub "arn:aws:iam::${AWS::AccountId}:role/${QuickSightDataSourceRole}", "" ]
athena-database: !If [NeedDatabase, !Ref CidDatabase, !Ref DatabaseName ]
glue-data-catalog: !Ref GlueDataCatalog
cur-table-name: !If [ NeedCURTable, !Ref MyCURTable, !Ref CURTableName ]
quicksight-user: !Ref QuickSightUser
account-map-source: 'dummy' #initial
share-with-account: 'yes'
Tags: # Hacky way to manage conditional dependencies
- Key: IgnoreNeedCostIntelligenceDashboard
Value: !If [NeedCostIntelligenceDashboard, !Ref CostIntelligenceDashboard, '']
KPIDashboard:
Type: Custom::CidDashboard
Condition: NeedKPIDashboard
Expand Down Expand Up @@ -1591,6 +1623,10 @@ Outputs:
Description: "URL of CUDOSDashboard"
Condition: NeedCUDOSDashboard
Value: !GetAtt CUDOSDashboard.DashboardURL
CUDOSv5DashboardURL:
Description: "URL of CUDOS Dashboard v5"
Condition: NeedCUDOSv5
Value: !GetAtt CUDOSv5Dashboard.DashboardURL
KPIDashboardURL:
Description: "URL of KPIDashboard"
Condition: NeedKPIDashboard
Expand Down

0 comments on commit 4423859

Please sign in to comment.