Skip to content

Automate s3 prefix naming #22

@rozhok

Description

@rozhok

I want to use single lambda for backing up of many tables.
Therefore, I want to distinguish s3 prefixes so I could easily restore only necessary tables.
Now I'm doing following

let eventSourceArn = event.Records[0].eventSourceARN;
let tableName = eventSourceArn.substring(
    eventSourceArn.indexOf('table/') + 6, 
    eventSourceArn.indexOf('stream/') - 1
);
let config = {
    S3Bucket: bucket,
    S3Region: 'eu-west-1',
    S3Prefix: tableName
};

Inside my lambda, but it looks as a hack. It would be nice to have such function bundled into backup-er.

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