diff --git a/lib/plugins/aws/info/index.js b/lib/plugins/aws/info/index.js index f997a67c3da..fd26795d5c9 100644 --- a/lib/plugins/aws/info/index.js +++ b/lib/plugins/aws/info/index.js @@ -8,6 +8,7 @@ const getStackInfo = require('./getStackInfo'); const getResourceCount = require('./getResourceCount'); const getApiKeyValues = require('./getApiKeyValues'); const display = require('./display'); +const { log } = require('@serverless/utils/log'); const mainProgress = progress.get('main'); @@ -72,11 +73,22 @@ class AwsInfo { 'aws:info:displayStackOutputs': async () => BbPromise.bind(this).then(this.displayStackOutputs), + 'after:aws:info:gatherData': () => { + if (this.gatheredData && this.gatheredData.info.resourceCount >= 450) { + log.warning( + `You have ${ + this.gatheredData.info.resourceCount + } resources in your service. CloudFormation has a hard limit of 500 resources in a service. For advice on avoiding this limit, check out this link: ${style.link( + 'http://slss.io/2q2' + )}.` + ); + } + }, + 'finalize': () => { if (this.serverless.processedInput.commands.join(' ') !== 'info') return; writeText( - null, `${style.aside('service:')} ${this.serverless.service.service}`, `${style.aside('stage:')} ${this.provider.getStage()}`, `${style.aside('region:')} ${this.provider.getRegion()}`,