From 0ced414174c8acf7dd70dd9b5e4b7a525cd8320e Mon Sep 17 00:00:00 2001 From: Piotr Grzesik Date: Fri, 18 Sep 2020 17:30:26 +0200 Subject: [PATCH] feat: Deprecate an attempt to extend nonexistent resources (#8266) --- docs/deprecations.md | 6 ++++++ lib/plugins/aws/package/lib/mergeCustomProviderResources.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/docs/deprecations.md b/docs/deprecations.md index 70e6ee71639..e734d9f9567 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -6,6 +6,12 @@ layout: Doc # Serverless Framework Deprecations +
 
+ +## Defining extensions to nonexistent resources in `resources.extensions` + +Starting with v3.0.0, extensions to nonexistent resources in `resources.extensions` will throw an error instead of passing silently. +
 
## Support for `enableLocalInstallationFallback` setting is to be removed diff --git a/lib/plugins/aws/package/lib/mergeCustomProviderResources.js b/lib/plugins/aws/package/lib/mergeCustomProviderResources.js index 464b2a21b62..cf6b1909f38 100644 --- a/lib/plugins/aws/package/lib/mergeCustomProviderResources.js +++ b/lib/plugins/aws/package/lib/mergeCustomProviderResources.js @@ -31,6 +31,10 @@ module.exports = { for (const [extensionAttributeName, value] of _.entries(resourceDefinition)) { if (!template.Resources[resourceName]) { template.Resources[resourceName] = {}; + this.serverless._logDeprecation( + 'RESOURCES_EXTENSIONS_REFERENCE_TO_NONEXISTENT_RESOURCE', + 'Starting with next major version, extensions to nonexistent resources will throw an error instead of passing silently.' + ); } switch (extensionAttributeName) {