Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Add region to dashboard name
Browse files Browse the repository at this point in the history
  • Loading branch information
johncmckim committed Aug 3, 2017
1 parent 8c5e822 commit 1541366
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Expand Up @@ -253,21 +253,22 @@ class Plugin {
const service = this.serverless.service;
const provider = service.provider;
const stage = this.options.stage;
const region = provider.region;

const functions = this.serverless.service
.getAllFunctions()
.map(functionName => ({ name: functionName }));

const dashboard = dashboards.createDashboard(service.service, stage, provider.region, functions, 'default');
const dashboard = dashboards.createDashboard(service.service, stage, region, functions, 'default');

const cf = {
AlertsDashboard: {
Type: 'AWS::CloudWatch::Dashboard',
Properties: {
DashboardName: `${service.service}-${stage}`,
DashboardName: `${service.service}-${stage}-${region}`,
DashboardBody: JSON.stringify(dashboard),
}
}
},
},
};

this.addCfResources(cf);
Expand Down

0 comments on commit 1541366

Please sign in to comment.