An open API service indexing awesome lists of open source software.

https://github.com/rhythmictech/terraform-azurerm-postgresql

Terraform module for Azure managed PostgreSQL Database
https://github.com/rhythmictech/terraform-azurerm-postgresql

azure postgresql terraform terraform-module

Last synced: 7 months ago
JSON representation

Terraform module for Azure managed PostgreSQL Database

Awesome Lists containing this project

README

          

# terraform-azurerm-postgresql
Terraform module for Azure managed PostgreSQL Database with optional metric alerting

[![tflint](https://github.com/rhythmictech/terraform-azurerm-postgresql/workflows/tflint/badge.svg?branch=master&event=push)](https://github.com/rhythmictech/terraform-azurerm-postgresql/actions?query=workflow%3Atflint+event%3Apush+branch%3Amaster)
[![tfsec](https://github.com/rhythmictech/terraform-azurerm-postgresql/workflows/tfsec/badge.svg?branch=master&event=push)](https://github.com/rhythmictech/terraform-azurerm-postgresql/actions?query=workflow%3Atfsec+event%3Apush+branch%3Amaster)
[![yamllint](https://github.com/rhythmictech/terraform-azurerm-postgresql/workflows/yamllint/badge.svg?branch=master&event=push)](https://github.com/rhythmictech/terraform-azurerm-postgresql/actions?query=workflow%3Ayamllint+event%3Apush+branch%3Amaster)
[![misspell](https://github.com/rhythmictech/terraform-azurerm-postgresql/workflows/misspell/badge.svg?branch=master&event=push)](https://github.com/rhythmictech/terraform-azurerm-postgresql/actions?query=workflow%3Amisspell+event%3Apush+branch%3Amaster)
[![pre-commit-check](https://github.com/rhythmictech/terraform-azurerm-postgresql/workflows/pre-commit-check/badge.svg?branch=master&event=push)](https://github.com/rhythmictech/terraform-azurerm-postgresql/actions?query=workflow%3Apre-commit-check+event%3Apush+branch%3Amaster)
follow on Twitter

## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.12.21 |
| terraform | >= 0.12 |
| azurerm | >= 1.40 |

## Providers

| Name | Version |
|------|---------|
| azurerm | >= 1.40 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| administrator\_login | The Administrator Login for the PostgreSQL Server. Changing this forces a new resource to be created. | `string` | n/a | yes |
| administrator\_password | The Password associated with the administrator\_login for the PostgreSQL Server. | `string` | n/a | yes |
| location | Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. | `string` | n/a | yes |
| resource\_group\_name | The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created. | `string` | n/a | yes |
| server\_name | Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created. Server name must only contain lowercase letters, numbers, and hyphens. The server name must not start or end in a hyphen. | `string` | n/a | yes |
| backup\_retention\_days | Backup retention days for the server, supported values are between 7 and 35 days. | `number` | `7` | no |
| dbs | Map of databases to create, values supported: name, charset, collation | `map(map(string))` | `{}` | no |
| firewall\_rules | Map of firewall rules to create. Key is rule name, values are start\_ip, end\_ip | `map(map(string))` | `{}` | no |
| geo\_redundant\_backup | Enable Geo-redundant or not for server backup. Valid values for this property are Enabled or Disabled, not supported for the basic tier. | `string` | `"Disabled"` | no |
| monitor\_action\_group\_id | ID of Azure Monitor Action Group for metric to trigger | `string` | `""` | no |
| monitor\_metric\_alert\_criteria | Map of name = criteria objects, see these docs for options
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftdbforpostgresqlservers |

map(object({
# criteria.*.aggregation to be one of [Average Count Minimum Maximum Total]
aggregation = string
metric_name = string
# criteria.0.operator to be one of [Equals NotEquals GreaterThan GreaterThanOrEqual LessThan LessThanOrEqual]
operator = string
threshold = number

dimension = map(object({
name = string
operator = string
values = list(string)
}))
}))
| `{}` | no |
| postgresql\_configurations | Map of PostgreSQL configuration settings to create. Key is config name, value is config value | `map(string)` | `{}` | no |
| server\_version | Specifies the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, and 11. Changing this forces a new resource to be created. | `string` | `"11"` | no |
| sku\_name | Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. B\_Gen4\_1, GP\_Gen5\_8). | `string` | `"B_Gen4_2"` | no |
| ssl\_enforcement | Specifies if SSL should be enforced on connections. Possible values are Enabled and Disabled. | `string` | `"Enabled"` | no |
| storage\_autogrow | Enable/Disable auto-growing of the storage. Valid values for this property are Enabled or Disabled. | `string` | `"Enabled"` | no |
| storage\_mb | Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. | `number` | `5120` | no |
| tags | User-Defined tags | `map(string)` | `{}` | no |
| vnet\_rules | Map of vnet rules to create. Key is name, value is vnet id | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| administrator\_login | Admin username |
| administrator\_password | Password for admin user |
| server\_fqdn | The fully qualified domain name (FQDN) of the PostgreSQL server |
| server\_id | The resource id of the PostgreSQL server |
| server\_name | The name of the PostgreSQL server |