Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.

About

Lambda function for executing pg_dump and streaming the output to s3.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgdump-aws-lambda

Overview

A simple AWS Lambda function that runs pg_dump and streams the output to s3.

Using AWS, you can schedule it to run periodically.

Instructions

  1. Create an AWS lambda function using the zip as "function package".
  2. Add a "CloudWatch Events - Schedule" trigger.
  3. In the 'rule', setup your schedule and configure the lamba input to something like:
{
    "PGHOST": "database.myserver.com",
    "PGUSER": "my-user",
    "PGPASSWORD": "my-password",
    "PGDATABASE": "my-database-name",
    "S3_BUCKET": "my-s3-backup-bucket",
    "SUBKEY": "production"
}

File Naming

This function will store your backup with the following s3 key:

s3://${S3_BUCKET}/${SUBKEY}/YYYY-MM-DD/YYYY-MM-DD@HH-mm-ss.backup

About

Lambda function for executing pg_dump and streaming the output to s3.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages