Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Supporting calling via SQS events with backup config in SQS message #48

@bigpresh

Description

@bigpresh

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions