Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for anyone who needs to build websites or web applications. It includes everything you need to launch your project quickly - instances (virtual private servers), container services, managed databases, content delivery network (CDN) distributions, load balancers, SSD-based block storage, static IP addresses, DNS management of registered domains, and resource snapshots (backups) - for a low, predictable monthly price.
PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
Using a managed database simplifies setup and maintenance, offering automated backups, disaster recovery, and high availability. It provides scalability to handle increased traffic, robust security features, and performance optimization for responsive user experiences, streamlining development and ensuring data reliability.
Step 1: Sign up for an AWS Account
Start by creating your own AWS account. This will give you access to a variety of powerful tools and resources provided by Amazon Web Services, allowing you to easily build, deploy, and manage your applications in the cloud.
Step 2: Create a PostgreSQL managed database
If you want to change the AWS Region and Availability Zone then click on: Change AWS Region and Availability Zone
Pick your database:
Specify Database options like username, password and database name
Choose your database plan
The good news is that AWS Lightsail offers first 3 months free for the Database instance.
Choose a name for your database
Step 3: Connect to your database
Pre-requisite
To get the connection details for your database
Choose the database name you want to connect to
On the connect tab note the endpoint and port number.
On the connect tab note the username and password of the database.
Configure the public availability of your database
Configure database client to connect to your PostgreSQL Database:
Host name/address — Enter the database endpoint that you obtained earlier. If you copied the database endpoint from the Lightsail console, and it’s still in your clipboard, press Ctrl+V if you’re using Windows, or Cmd+V if you’re using macOS, to paste it.
Port — Enter the port for your database that you obtained earlier. The default port for PostgreSQL is 5432.
Maintenance database — Specify the name of the initial database to which the client will connect. This is the primary database name that you specified when you created your PostgreSQL database in Lightsail.
Enter postgres
if you can’t remember the name of your primary database. Every PostgreSQL managed database has a postgres
database that you can connect to, after which you’ll be able to access all other databases on the PostgreSQL managed database.
Username — Enter the database user name that you obtained earlier.
Password — Enter your database password that you obtained earlier. If you copied your password from the Lightsail console, and it’s still in your clipboard, press Ctrl+V if you’re using Windows, or Cmd+V if you’re using macOS, to paste it. Choose Save password to save your password.
Role and Service — Leave these fields blank.
Conclusively, with Lightsail, setting up and accessing your database is a breeze. Whether you're configuring it for data import or connecting through a database client, Lightsail offers simplicity and efficiency, empowering you to swiftly embark on your development journey with confidence.