File tree Expand file tree Collapse file tree
packages/@aws-cdk/aws-cloudwatch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ export interface DashboardProps {
7676 */
7777export class Dashboard extends Resource {
7878 /**
79- * The name of this queue
79+ * The name of this dashboard
8080 * @attribute
8181 */
82- public readonly dashboardName ? : string | undefined ;
82+ public readonly dashboardName : string ;
8383 private readonly rows : IWidget [ ] = [ ] ;
8484
8585 constructor ( scope : Construct , id : string , props : DashboardProps = { } ) {
@@ -113,7 +113,8 @@ export class Dashboard extends Resource {
113113 } ) ,
114114 } ) ;
115115
116- this . dashboardName = dashboard . dashboardName ;
116+ this . dashboardName = this . getResourceNameAttribute ( dashboard . ref ) ;
117+ // dashboard.dashboardName;
117118
118119 ( props . widgets || [ ] ) . forEach ( row => {
119120 this . addWidgets ( ...row ) ;
Original file line number Diff line number Diff line change @@ -161,21 +161,6 @@ describe('Dashboard', () => {
161161
162162 } ) ;
163163
164- test ( 'DashboardName is exposed correctly when provided' , ( ) => {
165- // GIVEN
166- const app = new App ( ) ;
167- const stack = new Stack ( app , 'MyStack' ) ;
168-
169- // WHEN
170- const dash = new Dashboard ( stack , 'MyDashboard' , {
171- dashboardName : 'MyCustomDashboardName' ,
172- } ) ;
173-
174- // THEN
175- expect ( dash . dashboardName ) . toEqual ( 'MyCustomDashboardName' ) ;
176-
177- } ) ;
178-
179164 test ( 'throws if DashboardName is not valid' , ( ) => {
180165 // GIVEN
181166 const app = new App ( ) ;
You can’t perform that action at this time.
0 commit comments