{"id":37227804,"url":"https://github.com/paybilldev/terraform-aws-postgresql","last_synced_at":"2026-01-15T03:24:08.093Z","repository":{"id":331688184,"uuid":"1125814689","full_name":"paybilldev/terraform-aws-postgresql","owner":"paybilldev","description":"Automates PostgreSQL setup and user management","archived":false,"fork":false,"pushed_at":"2026-01-10T19:40:56.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T05:50:01.667Z","etag":null,"topics":["aws","postgresql","terraform"],"latest_commit_sha":null,"homepage":"https://paybill.dev/docs/platform/terraform/aws/postgresql","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paybilldev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"buy_me_a_coffee":"ebartile"}},"created_at":"2025-12-31T12:17:36.000Z","updated_at":"2026-01-10T19:41:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paybilldev/terraform-aws-postgresql","commit_stats":null,"previous_names":["paybilldev/terraform-aws-postgresql"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paybilldev/terraform-aws-postgresql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybilldev%2Fterraform-aws-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybilldev%2Fterraform-aws-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybilldev%2Fterraform-aws-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybilldev%2Fterraform-aws-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paybilldev","download_url":"https://codeload.github.com/paybilldev/terraform-aws-postgresql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybilldev%2Fterraform-aws-postgresql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","postgresql","terraform"],"created_at":"2026-01-15T03:24:07.336Z","updated_at":"2026-01-15T03:24:08.073Z","avatar_url":"https://github.com/paybilldev.png","language":"HCL","funding_links":["https://buymeacoffee.com/ebartile"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://paybill.dev\" target=\"_blank\"\u003e\n    \u003cpicture\u003e\n      \u003cimg src=\"./static/aws-postgresql.png\" alt=\"Banner\" /\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Terraform Module: Postgres\n\nThis Terraform module automates PostgreSQL setup and user management. In simple terms, it allows you to:\n\n### **1. Create PostgreSQL Databases**\n\n* Provisions multiple databases based on `postgresql_database` input.\n* Supports configuration like template, collation, connection limits, etc.\n\n### **2. Manage Database Schemas**\n\n* Creates schemas in PostgreSQL using `postgresql_schema`.\n* Optional policies can be applied for schema usage and access control.\n\n### **3. Set Default Privileges**\n\n* Configures default privileges for roles on specific objects inside a database.\n\n### **4. Create PostgreSQL Users + Generate Passwords**\n\n* Optionally generates random passwords for users using `random_password`.\n* Creates roles/users with login access.\n\n### **5. Store Credentials Securely in AWS SSM Parameter Store**\n\n* Generated usernames \u0026 passwords are saved as SecureString parameters for safe retrieval.\n\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.3.0 |\n| \u003ca name=\"requirement_postgresql\"\u003e\u003c/a\u003e [postgresql](#requirement\\_postgresql) | ~\u003e 1.21 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | n/a |\n| \u003ca name=\"provider_null\"\u003e\u003c/a\u003e [null](#provider\\_null) | n/a |\n| \u003ca name=\"provider_postgresql\"\u003e\u003c/a\u003e [postgresql](#provider\\_postgresql) | ~\u003e 1.21 |\n| \u003ca name=\"provider_random\"\u003e\u003c/a\u003e [random](#provider\\_random) | n/a |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_ssm_parameter.pg_user_parameters](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |\n| [aws_ssm_parameter.pg_user_password_parameters](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |\n| [null_resource.trigger_password_generation](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |\n| [postgresql_database.pg_db](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/database) | resource |\n| [postgresql_default_privileges.default_privileges](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/default_privileges) | resource |\n| [postgresql_role.pg_users](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/role) | resource |\n| [postgresql_schema.pg_schema](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/schema) | resource |\n| [random_password.pg_user_passwords](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_connect_timeout\"\u003e\u003c/a\u003e [connect\\_timeout](#input\\_connect\\_timeout) | connection timeout of the database | `number` | `15` | no |\n| \u003ca name=\"input_database\"\u003e\u003c/a\u003e [database](#input\\_database) | Name of the database | `string` | `\"postgres\"` | no |\n| \u003ca name=\"input_host\"\u003e\u003c/a\u003e [host](#input\\_host) | Database host | `string` | `\"\"` | no |\n| \u003ca name=\"input_parameter_name_prefix\"\u003e\u003c/a\u003e [parameter\\_name\\_prefix](#input\\_parameter\\_name\\_prefix) | Prefix for the SSM parameter name | `string` | `\"\"` | no |\n| \u003ca name=\"input_password\"\u003e\u003c/a\u003e [password](#input\\_password) | Database password | `string` | `\"\"` | no |\n| \u003ca name=\"input_pg_users\"\u003e\u003c/a\u003e [pg\\_users](#input\\_pg\\_users) | n/a | \u003cpre\u003elist(object({\u003cbr/\u003e    name  = string\u003cbr/\u003e    login = bool\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_port\"\u003e\u003c/a\u003e [port](#input\\_port) | Database port | `number` | `5432` | no |\n| \u003ca name=\"input_postgresql_database\"\u003e\u003c/a\u003e [postgresql\\_database](#input\\_postgresql\\_database) | configuration block for postgresql database | \u003cpre\u003emap(object({\u003cbr/\u003e    db_name = string\u003cbr/\u003e    //db_owner          = string\u003cbr/\u003e    template          = optional(string, null)\u003cbr/\u003e    lc_collate        = optional(string, null)\u003cbr/\u003e    connection_limit  = optional(string, null)\u003cbr/\u003e    allow_connections = optional(string, null)\u003cbr/\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_postgresql_default_privileges\"\u003e\u003c/a\u003e [postgresql\\_default\\_privileges](#input\\_postgresql\\_default\\_privileges) | configuration block for postgresql default privileges | \u003cpre\u003emap(object({\u003cbr/\u003e    role        = string\u003cbr/\u003e    database    = string\u003cbr/\u003e    schema      = string\u003cbr/\u003e    owner       = string\u003cbr/\u003e    object_type = string\u003cbr/\u003e    privileges  = list(string)\u003cbr/\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_postgresql_schema\"\u003e\u003c/a\u003e [postgresql\\_schema](#input\\_postgresql\\_schema) | configuration block for postgresql schema | \u003cpre\u003emap(object({\u003cbr/\u003e    schema_name   = string\u003cbr/\u003e    schema_owner  = optional(string, null)\u003cbr/\u003e    database      = optional(string, null)\u003cbr/\u003e    if_not_exists = optional(string, null)\u003cbr/\u003e    drop_cascade  = optional(string, null)\u003cbr/\u003e\u003cbr/\u003e    policy = optional(list(object({\u003cbr/\u003e      usage = optional(string, null)\u003cbr/\u003e      role  = optional(string, null)\u003cbr/\u003e    })), [])\u003cbr/\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_sslmode\"\u003e\u003c/a\u003e [sslmode](#input\\_sslmode) | sslmode of the database | `string` | `\"require\"` | no |\n| \u003ca name=\"input_superuser\"\u003e\u003c/a\u003e [superuser](#input\\_superuser) | Defines whether the role is a superuser, and therefore can override all access restrictions within the database | `string` | `false` | no |\n| \u003ca name=\"input_username\"\u003e\u003c/a\u003e [username](#input\\_username) | User name of the database | `string` | `\"is_root\"` | no |\n\n## Outputs\n\nNo outputs.\n\u003c!-- END_TF_DOCS --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaybilldev%2Fterraform-aws-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaybilldev%2Fterraform-aws-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaybilldev%2Fterraform-aws-postgresql/lists"}