FEATURES PRICING ABOUT DOCS LOGIN

PostgreSQL Provider

The PostgreSQL provider gives the ability to deploy and configure resources in a PostgreSQL server.

Use the navigation to the left to read about the available resources.

Usage

provider "postgresql" {
  host = "postgres_server_ip"
  port = 5432
  username = "postgres_user"
  password = "postgres_password"
  ssl_mode = "require"
}

Configuring multiple servers can be done by specifying the alias option.

provider "postgresql" {
  alias = "pg1"
  host = "postgres_server_ip1"
  username = "postgres_user1"
  password = "postgres_password1"
}

provider "postgresql" {
  alias = "pg2"
  host = "postgres_server_ip2"
  username = "postgres_user2"
  password = "postgres_password2"
}

resource "postgresql_database" "my_db1" {
  provider = "postgresql.pg1"
  name = "my_db1"
}
resource "postgresql_database" "my_db2" {
  provider = "postgresql.pg2"
  name = "my_db2"
}


Argument Reference

The following arguments are supported:


See the source of this document at Terraform.io

REQUEST A DEMO