Just need a AWS Postgres Database for testing.
If you choose RDS -> Create Database -> Engine type: PostgreSQL, it will cost around 100$. Another way is, we can choose Engine Type: Amazon Aurora, Aurora has 2 version, PostgreSQL-Compatible Edition can satisfy my requirement.
To create, just following official document : Creating a DB cluster and connecting to a database on an Aurora PostgreSQL DB cluster. Only one thing don’t forget, fill database name in : Additional configuration -> Initial database name, otherwise you have to create manually.
Finally, it will looks like follwing picture.
- Hostname is: Connectivity & security -> Endpoint
- Port is: Connectivity & security -> Port
- Database is: Configuration -> DB name
- User name and Password was filled in when creating DB.
I was creating with default configuration, when I trying to connect, encountered a error:
AWS RDS [08001] The connection attempt failed. The connection attempt failed.
First, it could be not allowd to access publicly. Make sure Connectivity & security -> Publicly accessible is YES.
Secound, It could be VPC Security Group configuration issue. Please go to:
- Connectivity & security -> VPC security groups
- Click the link : default (sg-xxxxxxxxxxxxxx)
- Go to tab Security Groups -> Inbound Rules -> Edit inbound rules
- Add one rule for Postgres: Type: PostgreSQL allow incoing address or just your own IP address