github.com/leeprovoost/terraform@v0.6.10-0.20160119085442-96f3f76118e7/website/source/docs/providers/postgresql/index.html.markdown (about) 1 --- 2 layout: "postgresql" 3 page_title: "Provider: PostgreSQL" 4 sidebar_current: "docs-postgresql-index" 5 description: |- 6 A provider for PostgreSQL Server. 7 --- 8 9 # PostgreSQL Provider 10 11 The PostgreSQL provider gives the ability to deploy and configure resources in a PostgreSQL server. 12 13 Use the navigation to the left to read about the available resources. 14 15 ## Usage 16 17 ``` 18 provider "postgresql" { 19 host = "postgres_server_ip" 20 port = 5432 21 username = "postgres_user" 22 password = "postgres_password" 23 } 24 25 ``` 26 27 Configuring multiple servers can be done by specifying the alias option. 28 29 ``` 30 provider "postgresql" { 31 alias = "pg1" 32 host = "postgres_server_ip1" 33 username = "postgres_user1" 34 password = "postgres_password1" 35 } 36 37 provider "postgresql" { 38 alias = "pg2" 39 host = "postgres_server_ip2" 40 username = "postgres_user2" 41 password = "postgres_password2" 42 } 43 44 resource "postgresql_database" "my_db1" { 45 provider = "postgresql.pg1" 46 name = "my_db1" 47 } 48 resource "postgresql_database" "my_db2" { 49 provider = "postgresql.pg2" 50 name = "my_db2" 51 } 52 53 54 ``` 55 56 ## Argument Reference 57 58 The following arguments are supported: 59 60 * `host` - (Required) The address for the postgresql server connection. 61 * `port` - (Optional) The port for the postgresql server connection. (Default 5432) 62 * `username` - (Required) Username for the server connection. 63 * `password` - (Optional) Password for the server connection.