Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

RDS Postgres configuration

  • Log in to AWS Management Console and search with the keyword 'RDS'. You will be redirected to the RDS Home Page

  • Click on the Create Database and Select Postgres and required version

  • DB Instance Settings – select type and set username and password also specify Instance Size and Storage.

  • In Additional Configuration we can add initial database.

  • Click On Create Database you will see the resource creation progress.

  • It will take some time to provision the resources and return the Endpointalong with a few more details.

Refer: PostgreSQL Database Instance Creation and Configuration in AWS RDS - DEV Community 👩‍💻👨‍💻with Postgres Configuration

Connectivity

  • PgAdmin4 – RDS Postgres

    • On the Dashboard tab, choose Add New Server.

    • In the Create

      • Server dialog box, type a name on the General tab.

    • On the Connection tab, type the details of the DB instance:

      • Enter the Host as the endpoint name.

      • Type the username and password that you entered when you created the DB instance.

      • For Port, type the assigned port: 5432.

  • Grafana – RDS Postgres

    • Create user in the PgAdmin for grafana and create a database in the AWS Postgres server.

    • Open defaults.ini in grafana config folder.

    • Update the host with the RDS endpoint and add user and password in Database section.

...

user = postgres

password =<DB password>

  • Insights – RDS Postgres

    • The Insights database was created during the DB instance creation we can check that in the PgAdmin.

    • Open server-config.json in Insights-Home.

    • In the Postgres section update the username and password.

    • Also update the insightsDBUrl and grafanaDBUrl using the end point.

    • Restart the Platform service and it will generate the required table we can check that in PgAdmin.

...

"grafanaDBUrl": "jdbc:postgresql://postgres.xxx.rds.amazonaws.com:5432/grafana"

}

Postgres backup

  • We can take backup of the database in our system by creating dump.sql.

  • Command to create dump.sql:

    • pg_dump -h <end_point> -U <my username> -f dump.sql <db name>

    • Eg: pg_dump -h postgres.xxx.rds.amazonaws.com -U postgres -f dump.sql insight

Cost Analysis

Instance type: db.t3t2.medium large | vCPU: 2 | Memory: 4 8 GiB | Region: US East (Ohio)

...

On Demand

...

Reserved Instance

...

Multi AZ

...

Single AZ

...

Multi AZ

...

Single AZ

...

Amazon RDS PostgreSQL instances cost (Monthly)

...

105.85 USD

52.56 USD

...

72.86 USD

...

17.96 USD

...

Monthly Cost for RDS Proxy (Monthly)

21.90 USD

21.90 USD

...

21.90 USD

...

21.90 USD

...

Storage pricing (Monthly)

...

20 GB per month x 0.23 USD x 1 instances = 4.60 USD (Storage Cost)

...

20 GB per month x 0.115 USD x 1 instances = 2.30 USD (Storage Cost)

...

20 GB per month x 0.23 USD x 1 instances = 4.60 USD (Storage Cost)

...

20 GB per month x 0.115 USD x 1 instances = 2.30 USD (Storage Cost)

...

Additional backup storage cost (Monthly)

1.90 USD

20 GB x 0.095 USD = 1.90 USD

1.90 USD

20 GB x 0.095 USD = 1.90 USD

1.90 USD

20 GB x 0.095 USD = 1.90 USD

1.90 USD

20 GB x 0.095 USD = 1.90 USD

...

Snapshot Export cost (Monthly)

...

0.20 USD

20 GB x 0.01 USD = 0.20 USD

0.20 USD

20 GB x 0.01 USD = 0.20 USD

...

0.20 USD

20 GB x 0.01 USD = 0.20 USD

0.20 USD

20 GB x 0.01 USD = 0.20 USD

...

Amazon RDS PostgreSQL instances cost (Upfront)

...

0

...

0

...

845.00 USD

...

216.00 USD

...

Total (Monthly)

134.45 USD

...

78.86 USD

...

28.60 USD

...

44.26 USD

...

Total 12 months cost

1613.40 USD

946.32 USD

...

1,935.30 USD

...

N.Virginia)

View file
nameAWS_RDS_PricingCalculator.pdf