Postgres-db module creates all the necessary configurations for the provided database cluster. Depending on the input variables, this module will create multiple databases, users, schemas. For the users' privileges, each user can be granted different roles based on the input. There are only three roles to be granted for each database: Admin, Read_Write, and Read_Only.
Create a virtual environment and install requirements.
sudo apt install snapd
sudo snap install go --classic
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pre-commit install
- pip
terraform-postgres-dbneeds as an input the list of databases to be initially created within the RDS cluster specified by theprovider_configinput, along with schemas and users. Within theschemasinput you can specify which database the schema should be created in. Also, within theusersinput you can specify the privileges each user needs to be granted on each database created.
| Name | Version |
|---|---|
| postgresql | 1.22.0 |
| Name | Version |
|---|---|
| postgresql | 1.22.0 |
No modules.
| Name | Type |
|---|---|
| postgresql_database.simple | resource |
| postgresql_extension.assets_postgis | resource |
| postgresql_grant.revoke_database | resource |
| postgresql_schema.schemas | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| databases | List of databases that will be created. | list(string) |
n/a | yes |
| provider_config | n/a | map(any) |
{ |
no |
| provider_pass | n/a | string |
n/a | yes |
| schemas | Map of schemas to be created in a specific database. | map(object({ database = string })) |
{} |
no |
No outputs.