mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
fix(AWS Deploy): Throw on attempt of extending not existing resource
This commit is contained in:
parent
10842513f0
commit
02be86ca49
@ -382,6 +382,8 @@ Please use `provider.kmsKeyArn` and `functions[].kmsKeyArn`. `service.awsKmsKeyA
|
||||
|
||||
Deprecation code: `RESOURCES_EXTENSIONS_REFERENCE_TO_NONEXISTENT_RESOURCE`
|
||||
|
||||
_Note: This deprecation was replaced with a thrown error (adding a deprecation here, was a logical error). Please upgrade to latest version of the Framework_
|
||||
|
||||
Starting with v3.0.0, extensions to nonexistent resources in `resources.extensions` will throw an error instead of passing silently.
|
||||
|
||||
<a name="DISABLE_LOCAL_INSTALLATION_FALLBACK_SETTING"><div> </div></a>
|
||||
|
||||
@ -30,10 +30,9 @@ module.exports = {
|
||||
for (const [resourceName, resourceDefinition] of Object.entries(extensions)) {
|
||||
for (const [extensionAttributeName, value] of Object.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.'
|
||||
throw new ServerlessError(
|
||||
`Cannot extend "${resourceName}" resource, as it's not found in generated stack`,
|
||||
'RESOURCE_EXTENSION_NOT_EXISTING'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user