Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add plugin dashboard deployment #850

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
33 changes: 33 additions & 0 deletions cfn-templates/cid-cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1782,3 +1782,36 @@ Outputs:
Description: "URL of ComputeOptimizerDashboard"
Condition: NeedComputeOptimizerDashboard
Value: !GetAtt ComputeOptimizerDashboard.DashboardURL
CidExecArn:
Description: Technical Value - CidExecArn
Value: !GetAtt CidExec.Arn
Export: { Name: !Sub 'cid${Suffix}-CidExecArn'}
AthenaWorkgroup:
Description: Technical Value - AthenaWorkgroup
Value: !If [ NeedAthenaWorkgroup, !Ref MyAthenaWorkGroup, !Ref AthenaWorkgroup ]
Export: { Name: !Sub 'cid${Suffix}-AthenaWorkgroup'}
QuickSightDatasourceId:
Description: Technical Value - QuickSightDatasourceId
Value: !If [ NeedDatasource, !Select [ 1, !Split [ '/', !GetAtt CidAthenaDataSource.Arn]], 'CID-Athena-1']
Export: { Name: !Sub 'cid${Suffix}-QuickSightDatasourceId'}
QuickSightDatasourceRoleArn:
Description: Technical Value - QuickSightDatasourceRoleArn
Value: !If [ NeedQuickSightDataSourceRole, !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${QuickSightDataSourceRole}", "" ]
Export: { Name: !Sub 'cid${Suffix}-QuickSightDatasourceRoleArn'}
AthenaDatabase:
Description: Technical Value - AthenaDatabase
Value: !If [NeedDatabase, !Ref CidDatabase, !Ref DatabaseName ]
Export: { Name: !Sub 'cid${Suffix}-AthenaDatabase'}
GlueCatalog:
Description: Technical Value - GlueCatalog
Value: !Ref GlueDataCatalog
Export: { Name: !Sub 'cid${Suffix}-GlueCatalog'}
CurTableName:
Description: Technical Value - CurTableName
Value: !If [ NeedCURTable, !Ref MyCURTable, !Ref CURTableName ]
Export: { Name: !Sub 'cid${Suffix}-CurTableName'}
QuickSightUser:
Description: Technical Value - QuickSightUser
Value: !Ref QuickSightUser
Export: { Name: !Sub 'cid${Suffix}-QuickSightUser'}

42 changes: 42 additions & 0 deletions cfn-templates/cid-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: Deployment of Cloud Intelligence Dashboards v0.3.5

Parameters:
CidMainStackPrefix:
Type: String
Description: 'Please enter exactly the same prefix as you have in your main CID stack'
Default: 'cid'
DashboardId:
Type: String
Description: 'Dashboard id'
Default: ''
ResourcesUrl:
Type: String
Description: 'Resources url'
Default: ''

Conditions:
ResourcesUrlIsEmpty: !Equals [!Ref ResourcesUrl, '']

Resources:
Dashboard:
Type: Custom::CidDashboard
Properties:
Name: !Ref DashboardId
ServiceToken: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-CidExecArn" }
Fixed Show fixed Hide fixed
Dashboard:
dashboard-id: !Ref DashboardId
athena-workgroup: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-AthenaWorkgroup" }
quicksight-datasource-id: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-QuickSightDatasourceId" }
quicksight-datasource-role-arn: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-QuickSightDatasourceRoleArn" }
athena-database: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-AthenaDatabase" }
glue-data-catalog: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-GlueCatalog" }
cur-table-name: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-CurTableName" }
quicksight-user: {Fn::ImportValue: !Sub "${CidMainStackPrefix}-QuickSightUser" }
share-with-account: 'yes'
resources: !If [ResourcesUrlIsEmpty, !Ref 'AWS::NoValue', !Ref ResourcesUrl ]

Outputs:
DashboardURL:
Description: "URL of Dashboard"
Value: !GetAtt Dashboard.DashboardURL
Loading