-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.js
29 lines (25 loc) · 811 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict'
const naming = require('./naming')
const ref = {}
class AWSNaming {
constructor(serverless, options) {
const self = this
ref.self = self
this.serverless = serverless
this.service = serverless.service
this.serverlessLog = serverless.cli.log.bind(serverless.cli)
this.options = options
this.hooks = {
'before:package:finalize': naming.fixLogGroups.bind(this)
}
self.start()
}
start() {
ref.self.serverlessLog('Setting custom naming conventions...')
var aws = ref.self.serverless.getProvider('aws')
Object.assign(aws.naming, naming)
ref.self.serverless.cli.log('Setting custom function names...')
naming.setFunctionNames(aws)
}
}
module.exports = AWSNaming