{"id":13707215,"url":"https://github.com/avinor/terraform-azurerm-postgresql","last_synced_at":"2025-05-06T00:30:36.639Z","repository":{"id":45378976,"uuid":"214417349","full_name":"avinor/terraform-azurerm-postgresql","owner":"avinor","description":"Terraform module to deploy a PostgreSQL server with databases","archived":false,"fork":false,"pushed_at":"2024-09-25T13:03:27.000Z","size":281,"stargazers_count":4,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-13T15:49:42.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avinor.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}},"created_at":"2019-10-11T11:20:16.000Z","updated_at":"2024-09-25T13:01:56.000Z","dependencies_parsed_at":"2023-12-21T15:38:55.202Z","dependency_job_id":"4e3f2aa0-6dfa-4217-9ee1-12c528289fc9","html_url":"https://github.com/avinor/terraform-azurerm-postgresql","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinor%2Fterraform-azurerm-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinor%2Fterraform-azurerm-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinor%2Fterraform-azurerm-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinor%2Fterraform-azurerm-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avinor","download_url":"https://codeload.github.com/avinor/terraform-azurerm-postgresql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252598168,"owners_count":21774215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-02T22:01:24.488Z","updated_at":"2025-05-06T00:30:36.357Z","avatar_url":"https://github.com/avinor.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# PostgresSQL server\n\nTerraform module to create a PostgreSQL server in Azure with set of databases and users. Database allows for custom configuration and enforces SSL for security reasons.\n\n## Limitations\n\nPassword is mandatory for database users. Set to null for auto generated password.\n\n## Usage\n\nExamples of usage for this terraform module can be found under the example directory.\n\nExample showing deployment of a server with single database using [tau](https://github.com/avinor/tau)\n\n```terraform\nmodule {\n  source  = \"avinor/postgresql/azurerm\"\n  version = \"2.0.4\"\n}\n\ninputs {\n  name                = \"simple\"\n  resource_group_name = \"simple-postgresql-rg\"\n  location            = \"westeurope\"\n\n  sku = {\n    capacity = 1\n    tier     = \"Basic\"\n    family   = \"Gen5\"\n  }\n\n  databases = [\n    {\n      name      = \"my_database\"\n      charset   = \"UTF8\"\n      collation = \"English_United States.1252\"\n      users = [\n        {\n          name     = \"a_user\"\n          password = null\n          grants = [\n            {\n              object_type : \"database\"\n              privileges : [\"CREATE\"]\n            },\n            {\n              object_type : \"table\"\n              privileges : [\"SELECT\", \"INSERT\", \"UPDATE\"]\n            }\n          ]\n        },\n      ]\n    },\n  ]\n}\n```\n\n## Diagnostics\n\nDiagnostics settings can be sent to either storage account, event hub or Log Analytics workspace. The variable `diagnostics.destination` is the id of receiver, ie. storage account id, event namespace authorization rule id or log analytics resource id. Depending on what id is it will detect where to send. Unless using event namespace the `eventhub_name` is not required, just set to `null` for storage account and log analytics workspace.\n\nSetting `all` in logs and metrics will send all possible diagnostics to destination. If not using `all` type name of categories to send.\n\n## Grant access\n\nEach user can be given a set of user grants. Each grant consists of an `object_type` and a list of `privileges`.\n`object_type` can be one of: `database`, `table`, `sequence` and `function`.\n`privileges` can be one or more of: `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, `REFERENCES`, `TRIGGER`, `CREATE`, `CONNECT`, `TEMPORARY`, `EXECUTE`, and `USAGE`\n\nExample:\n\nCreate a user that can create a table, select from and update it.\nTo be able to create a table it needs the `CREATE` privilege on the `database` object:\n```\n{\n  object_type : \"database\"\n  privileges : [\"CREATE\"]\n}\n```\nNote: This does not mean the user is allowed to create a new database.\n\nTo be able to select from and update the table, we can give it `SELECT`, `UPDATE` and `INSERT` privileges on the `table` object:\n```\n{\n  object_type : \"table\"\n  privileges : [\"SELECT\", \"INSERT\", \"UPDATE\"]\n}\n```\n\nFor more details on privileges in PostgreSQL see the official documentation: \u003chttps://www.postgresql.org/docs/13/ddl-priv.html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinor%2Fterraform-azurerm-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinor%2Fterraform-azurerm-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinor%2Fterraform-azurerm-postgresql/lists"}