Skip to content

Commit

Permalink
add userdata for rds
Browse files Browse the repository at this point in the history
  • Loading branch information
horakihor committed May 21, 2019
1 parent 4c01a6a commit ced45af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ Start Application
cd /opt/aws_course/app/
sudo make setup
sudo make run POSTGRES_URL="localhost:5432"

# Setup Application EC2 - User Data

We have 2 options to setup app with user-data:
- Local-DB (Setup local PostgreSQL)
- RDS-DB (Setup Application only)

Put one of the scripts to the User-data field in AWS.

Notes: Change RDS server hostname in user-data script before running.
11 changes: 11 additions & 0 deletions userdata/rds_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Setup Global
sudo yum -y group install "Development Tools"

# Setup App
sudo yum install -y python3 python3-devel git postgresql-devel
sudo git clone https://github.com/horakihor/aws_course.git /opt/aws_course && \
cd /opt/aws_course/app/ && \
sudo make setup && \
sudo make run POSTGRES_URL="<RDS-HOSTNAME>:5432"

0 comments on commit ced45af

Please sign in to comment.