UNPKG

serverless

Version:

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

45 lines (39 loc) 1.13 kB
'use strict'; const BbPromise = require('bluebird'); const validate = require('../lib/validate'); const getStackInfo = require('./getStackInfo'); const getApiKeyValues = require('./getApiKeyValues'); const display = require('./display'); class AwsInfo { constructor(serverless, options) { this.serverless = serverless; this.provider = this.serverless.getProvider('aws'); this.options = options || {}; Object.assign( this, validate, getStackInfo, getApiKeyValues, display ); this.hooks = { 'info:info': () => BbPromise.bind(this) .then(this.validate) .then(this.getStackInfo) .then(this.getApiKeyValues) .then(this.display), 'deploy:deploy': () => BbPromise.bind(this) .then(() => { if (this.options.noDeploy) { return BbPromise.resolve(); } return BbPromise.resolve().bind(this) .then(this.validate) .then(this.getStackInfo) .then(this.getApiKeyValues) .then(this.display); }), }; } } module.exports = AwsInfo;