Closed ajkerr closed 7 years ago
I've made another commit that basically restores the original code (except for the classname typo correction), and changes the hook from before:deploy:deploy
to before:aws:package:finalize:mergeCustomProviderResources
.
This allows us to modify the this.serverless.service.resources.Resources
object before it get merged into the compiled CloudFormation template.
The plugin now seems to work as it did before, although it's probably not compatible with pre-1.12 versions of Serverless.
Looks good to me, thanks!
Great, thanks for merging! Would it be possible for you to push a new version to npm soon?
@ajkerr I just published 1.0.0 to NPM. Thanks!
Changes were made in Serverless 1.12 that changed how package/deploy work. This PR is designed to fix #6.
Based on some discussion towards the end of https://github.com/serverless/serverless/pull/3344, it appears that the lifecycle has changed such that you can still modify this.serverless.service.provider.compiledCloudFormationTemplate to make in-memory changes to the template, but modifying other things, such as this.serverless.service.resources.Resources, has no effect.
This fix seems to work. The only visible change that I could see was that the changes are not persisted to disk, but they do get uploaded and updated in CloudFormation.
There may be a better way/place to do this (perhaps by using new package lifecycle events), but this does seem to get the plugin working again.