-
Notifications
You must be signed in to change notification settings - Fork 111
Description
Hi,
I'm trying to set up a use of pgdump-aws-lambda where it would be triggered by an SQS queue, with the params for the backup run in the queue message.
However, the event that pgdump-aws-lambda sees has the details it would need under Records
- e.g. event.Records[0].body
containing JSON.
I was thinking of raising a PR so that, if the event being processed has Records
, it will, if there is exactly one record, attempt to deserialize that record's Body
from JSON and put the values into the event... so that you can queue an SQS message with the PGDATABASE
, PGUSER
etc to be used, and pgdump would be triggered by SQS and understand how to get that information from the event.
I would assume that you'd configure the triggering to have a batch size of 1, rather than attempt to add a whole lot more complexity in one run of the lambda trying to back up multiple DBs in one execution - I think that would both make things more complex, and in general be a bad idea as you'd be more likely to run in to execution time issues - better to just trigger it off multiple times concurrently.
Does this sound like a reasonable idea?