In this article, we will see the step by step instructions for configuring the Postgres DB instance in AWS RDS.
Pre-requisites
To complete this learning, you will need:
β An AWS Account (Free Tier)
If you don't have an account visit https://aws.amazon.com and click Sign Up.
Amazon RDS is available on several database instance types - optimized for memory, performance or I/O
- Amazon Aurora
- PostgreSQL
- MySQL
- MariaDB
- Oracle
- SQL Server
PostgreSQL on EC2
You can manage your own DB instance by provisioning the EC2 instance and installing the Postgres Database.
Managed PostgreSQL on RDS
Managed RDS Service can handle the patching, backup, recovery, provisioning the resources, availability.
In this article, we focus on using the managed services AWS RDS for creating PostgreSQL Database Instance
Working with Amazon RDS via the AWS Management Console Step by Step Instructions
Step 1: Log in to AWS Management Console and search with the keyword 'RDS'. You will be redirected to the RDS Home Page
Step 2: Click on the Create Database
and Select Postgres
Step 4: DB Instance Size and Storage. For the Free tier, you will get 'db.t2.micro' instance.
Step 6: Additional Configuration
Step 8: Click On Create Database you will see the resource creation progress. It will take some time for provisioning the resources
Step 9: To view Connection Details click on the View Credential Details
Button
Step 10: Connect to AWS RDS Instance from your Local and execute the DB Scripts
Working with the AWS Command Line Interface
To control and automate Amazon RDS resources from the command line, use the AWS Command Line Interface (CLI)
Summary
You can see the detailed implementation and connecting the API to the RDS instance in below github project
sunilkumarmedium / CleanArchitectureApp
Clean Architecture Application Design from Scratch using Dotnet Core 3.1 WebApi and Angular 11 FrontEnd
CleanArchitectureApp
Clean Architecture Application Design from Scratch using Dotnet Core 3.1 WebApi and Angular 11 FrontEnd
Technologies
- ASP.NET Core 3.1
- NHibernate
- Angular 11
- Angular CLI 11
- Clean Architecture
- Swashbuckle.AspNetCore.Swagger
- Design Pattern: Command Query Responsibility Segregation (CQRS)
- Fluent Validation
- WebAPI Global Exception Middleware
- Login, Logout and Forgot Password using JWT tokens
- Microsoft Sql Server and Postgresql supported.
Pre-requisites
- .Net core 3.1 SDK
- Visual studio 2019 OR VSCode with C# extension
- NodeJs (Latest LTS)
- Microsoft SQL Server (Optional: If MS SQL server required instead of Sqlite during development)
- POSTGRESQL
Configuration
- Clone the repo: git clone https://github.com/sunilkumarmedium/CleanArchitectureApp.git
- Execute the sql scripts available in the folder
/sql/
- MSSQL use CleanArchitectureDB.sql
- POSTGRES use CleanArchitectureDB-Postgres
- Change the database connectionstring in appsettings.json
- Path : CleanArchitectureApp.WebApi/appsettings.Development.json or appsettings.json
-
"DBProvider": "MSSQL" ,
UseMSSQL
to connect to Microsoft SqlServer OrPOSTGRES
to connect to PostgreSQL database "ConnectionStrings": { "MSSQLConnection": "Data Source=DESKTOP-SUNILBO;Initial Catalog=CleanArchitectureDB;User ID=sa;Password=xxx;MultipleActiveResultSets=True", "PostgresConnection": "Server=127.0.0.1;Port=5432;Database=CleanArchitectureDB;User Id=postgres;Password=xxx;Timeout=30;TimeZone=UTC" }'
- cd toβ¦
Top comments (0)