As of Serverless version 1.34.1 (though probably an earlier version after 1.20.2), the key path serverless.service.resources.Resources no longer exists. The resources can now be found at serverless.service.provider.compiledCloudFormationTemplate.Resources instead.
This causes this line to create its own Resources object which is thrown out without being referenced by Serverless:
While you're at it, I would also recommend only setting the RetentionInDays property on the log group, rather than replacing the entire resource object.
Also, as of Serverless 1.26.0, logRetentionInDays is supported natively as a global option on provider, so this plugin would only be necessary to specify a different log retention policy for different functions.
As of Serverless version 1.34.1 (though probably an earlier version after 1.20.2), the key path
serverless.service.resources.Resources
no longer exists. The resources can now be found atserverless.service.provider.compiledCloudFormationTemplate.Resources
instead.This causes this line to create its own
Resources
object which is thrown out without being referenced by Serverless:resources.Resources = nco(resources.Resources, {});
(link)While you're at it, I would also recommend only setting the
RetentionInDays
property on the log group, rather than replacing the entire resource object.Also, as of Serverless 1.26.0,
logRetentionInDays
is supported natively as a global option onprovider
, so this plugin would only be necessary to specify a different log retention policy for different functions.