


Here is bootstrap #!/bin/sh set -euo pipefail # Initialization - load function handler source $LAMBDA_TASK_ROOT/"$(echo $_HANDLER | cut -d. >ls clusterdb libecpg.so.6.11 libpq.so.5.11 pg_isready pg_waldump createdb libecpg_compat.so.3 libpqwalreceiver.so pg_receivewal pgbench createuser libecpg_compat.so.3.11 pg_archivecleanup pg_restore psql dropdb libpgfeutils.a pg_basebackup pg_rewind reindexdb dropuser libpgtypes.so.3 pg_config pg_test_fsync vacuumdb libecpg.so libpgtypes.so.3.11 pg_dump pg_test_timing libecpg.so.6 libpq.so.5 pg_dumpall pg_upgrade Lambda Packagingįollowing the s tandard instructions from the AWS website i added the bootstrap and function.sh files to the same directory as my PostgreSQL libraries and binaries.
Aws postgresql lambda 2018 zip file#
With the zip file now on my Mac i can take a quicklook at what has been bundled up. docker docker run -it -v /~Documents/git/docker-postgresql-scheduler:/tmp/macbook pg-scheduler-build cp postgresql11-client-with-libraries.zip /tmp/macbook With the dockerfile specified to do all this for me i just needed to do a docker build and a docker run to get hold of the zip file. These were extracted using yumdownloader and rmpdev-extract tools into /var/task and a zip file created. I needed the PostgreSQL client and associated libraries.
Aws postgresql lambda 2018 install#
FROM centos:7 RUN yum -y install yum-utils rpmdevtools RUN yum -y install WORKDIR /tmp RUN yumdownloader postgresql11 RUN yumdownloader postgresql11-libs RUN rpmdev-extract *rpm RUN mkdir -p /var/task RUN cp -r /tmp/86_64/usr/pgsql-11/lib/* /var/task RUN cp -r /tmp/86_64/usr/pgsql-11/bin/* /var/task WORKDIR /var/task RUN zip -r9 /tmp/postgresql11-client-with-libraries.zip * Docker BuildĪfter googling (see helpful references at the end) i used Docker to get the binaries and libraries i needed to bundle up with the lambda function. We briefly had a chat about the bring your own runtime for AWS Lambda and also using a container with crontab. With this constraint in mind last week our Lead Database Engineer asked for some help with a cost effective way to run scheduled jobs against a PostgreSQL database. The one at the top of our AWS wish list is pg_cron. One minor gripe we have though is that certain PostgreSQL extensions are not available. We’re running in the AWS cloud and the vast majority of the time we really like it. I’m sure there will be more to share on that soon! For a while now the teams i’m working with are doing really exciting things with the PostgreSQL database.
