

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: RDS: Relational Database Service
incomplete
2: Create a PostgreSQL Database
incomplete
3: Connect to Your Database
incomplete
4: Connect App to Database
incomplete
5: RDS Storage and IOPS
incomplete
6: RDS Backups
incomplete
7: Read Replicas
incomplete
8: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Alright, let's get a database set up and ready to use.
PatientPing's data needs a proper home. Everyone is in constant fear that the next time Zach reboots things, we're going to lose data.
Create a PostgreSQL RDS instance (patientping-db) in your patientping VPC's private subnets (no public access!).
Cost check: A db.t3.micro instance costs about $0.018 per hour (~$13/month). Be sure to delete this when you're done. AWS only allows you to "pause" an RDS instance for a time, then it starts it up again.
Make sure you save your database password securely! You won't be able to connect to the DB from your application server without it.
AWS Free Tier issue: If the instance type dropdown is disabled, or all the instance types are greyed out, you'll need to create a database using the AWS CLI instead.
Go directly to the Tips section below and use the provided CLI commands.
Once the database status shows Available, run and submit the CLI tests.
If you want (or need) to use the AWS CLI instead of the web console, you can use the following commands.
aws rds describe-db-subnet-groups \
--db-subnet-group-name patientping-private-subnet-group
aws ec2 describe-subnets \
--filters Name=tag:Name,Values=patientping-private-a --query 'Subnets[0].SubnetId'
aws ec2 describe-subnets \
--filters Name=tag:Name,Values=patientping-private-b --query 'Subnets[0].SubnetId'
aws rds create-db-subnet-group \
--db-subnet-group-name patientping-private-subnet-group \
--db-subnet-group-description 'Private subnets for RDS DB instances' \
--subnet-ids PRIVATE_A_ID PRIVATE_B_ID
aws ec2 describe-vpcs \
--filters 'Name=tag:Name,Values=patientping' --query 'Vpcs[0].VpcId'
aws ec2 create-security-group \
--group-name patientping-rds-sg \
--description 'Security group for PatientPing RDS' \
--vpc-id VPC_ID
aws rds create-db-instance \
--db-instance-identifier patientping-db \
--db-instance-class db.t3.micro \
--engine postgres \
--master-username postgres \
--master-user-password YOUR_ALPHANUMERIC_PASSWORD \
--allocated-storage 20 \
--storage-type gp2 \
--db-name patientping \
--db-subnet-group-name patientping-private-subnet-group \
--vpc-security-group-ids SECURITY_GROUP_ID \
--availability-zone us-east-1a \
--no-publicly-accessible \
--no-multi-az \
--backup-retention-period 1 \
--no-enable-performance-insights \
--no-deletion-protection
aws rds wait db-instance-available --db-instance-identifier patientping-db