Conversation
This replaces the list of standard providers with a reference to serverless.service.provider.name, which by the time we run is populated with the current provider.
This allows us to remove events from functions in the same way that we can currently remove functions, with the very notable change that the keyword that we look for is 'disabled' instead of 'enabled'. We do this because in the AWS provider, the 'enabled' keyword already exists for some event types, with an existing meaning.
|
@abemedia Any thoughts? |
|
Hi @zelch, thanks for the PR. |
|
@abemedia I'm reasonably sure that this should not break any existing users, but I could definitely be mistaken. What did I miss that makes this a breaking change? :) |
|
Ah sorry didn't realise you also left the old syntax working. Just flew over it before. |
|
@abemedia No worries, perhaps I should improve the readme a little bit. The new syntax This is due to conflicts on the enabled keyword in AWS events, and not wanting to risk any new conflicts with functions on any providers. |
This PR does two things.
The first (and less significant) change is that it replaces the static list of standard providers, and uses a runtime variable to add the enabled parameter to functions in whatever the current provider is.
The second change extends the plugin to allow it to disable events as well as functions.
Critically, the keyword for disabling events is 'disabled: true' not 'enabled: false', this is because 'enabled' already exists for some AWS event types. (sqs has it, sns does not)