Skip to content

Commit

Permalink
cfn changes for cudos v5
Browse files Browse the repository at this point in the history
  • Loading branch information
Prykhodko committed Nov 7, 2023
1 parent 01327bb commit 0d4ae24
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 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 @@ -39,6 +39,7 @@ Metadata:
- QuickSightDataSetRefreshSchedule
- LambdaLayerBucketPrefix
- DataBuketsKmsKeyArns
- DeployCUDOSDashboard
ParameterLabels:
PrerequisitesQuickSight:
default: "I have enabled QuickSight Enterprise Edition AND I have a SPICE capacity in the current region."
Expand All @@ -51,7 +52,9 @@ Metadata:
CURBucketPath:
default: "Path to Cost and Usage report"
DeployCUDOSDashboard:
default: "Deploy CUDOS Dashboard"
default: "Deploy CUDOS Dashboard v4 [use for cleanup of old version only]"
DeployCUDOSv5:
default: "Deploy CUDOS v5 Dashboard"
DeployCostIntelligenceDashboard:
default: "Deploy CostIntelligenceDashboard"
DeployKPIDashboard:
Expand Down Expand Up @@ -143,17 +146,22 @@ Parameters:
CidVersion:
Type: String
MinLength: 5
Default: 0.2.30
Default: 0.2.31
Description: A version of CID package
Suffix:
Type: String
Description: Leave Empty. Do not use this Suffix it is not fully supported. For testing purposes only.
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 0d4ae24

Please sign in to comment.