Creates an EC2 server with Postgrest running, pointing to your database (probably RDS).
It sets the instance to autoupdate, and installs postgrest as a system service, pointing to your database.
-
Copy the rhel7.sh file into the user-data field on a new RHEL7 EC2 instance. You don't need SSH permissions, so remove them.
-
Update the first few lines of the pasted user-data in the AWS console to your intended postgrest.conf file, and uncomment them.
Note: This method is less secure because your DB password will be stored in plaintext in your AWS logs
-
Start an EC2 instance with a RHEL 7.x image (t2.micro with 10GB of local storage is plenty). Ensure the instance can talk to the database - recommend that it's in the same VPC and availability zone. Add SSH permissions to the inbound rules of the VPC security group
-
Log in as ec2-user and copy your postgrest config file to /usr/local/bin/postgrest.conf
-
SSH in and run this:
curl -sSL https://raw.githubusercontent.com/dvasdekis/postgrest-ec2/master/rhel7.sh | sudo sh
-
Remove SSH permissions from the inbound rules of the VPC security group. You ain't gonna need it.