Terraform provides benefits that include automated infrastructure management, lower deployment costs, and reduced provisioning time..
Full options for local or remote backends here: https://www.terraform.io/docs/language/settings/backends/index.html
For official reccomendations for your use case i.e. dev or enterprise please refer to the links for both AWS and HashiCorp below:
https://www.terraform.io/docs/enterprise/before-installing/postgres-requirements.html
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html
https://github.com/Cobra16319/TF-Backend-Example
Pay attention to the comments if you are on Intel or MAC M1 this project supports both. Consult docs below for vagrant.
https://learn.hashicorp.com/tutorials/vagrant/getting-started-boxes
Step # 1 Clone Repo to your local machine (Should have followed the Vagrant guide above unless on Mac M1 have docker or virtual box properly installed etc...)
git clone https://github.com/Cobra16319/Vagrant-TF-Enterprise-Psql-Dev.git
cd Vagrant-TF-Enterprise-Psql-Dev
vagrant up --provider=docker
vagrant ssh
sudo apt-get install git
git clone https://github.com/Cobra16319/Vagrant-TF-Enterprise-Psql-Dev.git
cd Vagrant-TF-Enterprise-Psql-Dev.git
chmod +x post-install.sh
./post-install.sh
git clone https://github.com/robertpeteuil/terraform-installer.git
sudo apt install unzip
cd current directory for what you just pulled
./terraform-install.sh
docker-compose up
Step # 5 Let your container run; pull up another terminal and get back into vagrant working directory you were in.
docker exec -it vagrant-tf-enterprise-psql-dev_db_1 /bin/bash
psql -U postgres
CREATE SCHEMA IF NOT EXISTS rails;
CREATE SCHEMA IF NOT EXISTS vault;
CREATE SCHEMA IF NOT EXISTS registry;
Step # 7 Execute Terraform with the following commands to finish lab and use Postgres as a backend for TF
Terraform init
Terraform plan
Terraform apply
psql -h 0.0.0.0 -p 5432 -U postgres