
Create a working user account and working database in the created PostgreSQL environment.

Initialize PostgreSQL database with initdb command.Install the official PostgreSQL yum repository ( ) on Amazon Linux 2 built on a local PC VM.The Ansible Playbook is available for reference from the Git repository below. This article describes the steps to install PostgreSQL 12 using the official PostgreSQL repository and the Ansible Playbook version of it.

The version that can be installed in the yum repository of Amazon Linux 2 is PostgreSQL9.2, which is slightly older. In recent years, when using RDB on AWS, most cases use RDS, so PostgreSQL is installed in EC2 instances is less frequent, but it may be used for a little validation etc.
