Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pellepelster/terraform-hcloud-solidblocks-rds-postgresql
A containerized PostgreSQL database with all batteries included backup solution powered by pgBackRest
https://github.com/pellepelster/terraform-hcloud-solidblocks-rds-postgresql
hetzner hetzner-cloud terraform terraform-modules
Last synced: 28 days ago
JSON representation
A containerized PostgreSQL database with all batteries included backup solution powered by pgBackRest
- Host: GitHub
- URL: https://github.com/pellepelster/terraform-hcloud-solidblocks-rds-postgresql
- Owner: pellepelster
- Created: 2023-05-11T19:55:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-28T19:41:12.000Z (2 months ago)
- Last Synced: 2024-09-27T19:01:58.079Z (about 1 month ago)
- Topics: hetzner, hetzner-cloud, terraform, terraform-modules
- Language: HCL
- Homepage: https://pellepelster.github.io/solidblocks/
- Size: 80.1 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RDS PostgreSQL
See [documentation](https://pellepelster.github.io/solidblocks/hetzner/rds/) for more details and usage examples.
## Requirements
| Name | Version |
|------|---------|
| [hcloud](#requirement\_hcloud) | >=1.48.0 |
| [http](#requirement\_http) | >= 3.3.0 |## Providers
| Name | Version |
|------|---------|
| [hcloud](#provider\_hcloud) | >=1.48.0 |
| [http](#provider\_http) | >= 3.3.0 |## Resources
| Name | Type |
|------|------|
| [hcloud_server.rds](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/server) | resource |
| [hcloud_volume_attachment.backup](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume_attachment) | resource |
| [hcloud_volume_attachment.data](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume_attachment) | resource |
| [hcloud_volume.backup](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/data-sources/volume) | data source |
| [hcloud_volume.data](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/data-sources/volume) | data source |
| [http_http.cloud_init_bootstrap_solidblocks](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [backup\_encryption\_passphrase](#input\_backup\_encryption\_passphrase) | If set the backups will be encrypted using this passphrase | `string` | `null` | no |
| [backup\_full\_calendar](#input\_backup\_full\_calendar) | systemd timer spec for full backups | `string` | `"*-*-* 20:00:00"` | no |
| [backup\_incr\_calendar](#input\_backup\_incr\_calendar) | systemd timer spec for incremental backups | `string` | `"*-*-* *:00:55"` | no |
| [backup\_local\_retention\_diff](#input\_backup\_local\_retention\_diff) | Local backup number of differential backups to retain. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-diff | `number` | `4` | no |
| [backup\_local\_retention\_full](#input\_backup\_local\_retention\_full) | Local backups full backup retention count/time. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-full | `number` | `7` | no |
| [backup\_local\_retention\_full\_type](#input\_backup\_local\_retention\_full\_type) | Local backups retention policy type [count, time]. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-full | `string` | `"count"` | no |
| [backup\_s3\_access\_key](#input\_backup\_s3\_access\_key) | AWS access key for S3 backups. To enable S3 backups `backup_s3_bucket`, `backup_s3_access_key` and `backup_s3_secret_key` have to be provided. | `string` | `null` | no |
| [backup\_s3\_bucket](#input\_backup\_s3\_bucket) | AWS bucket name for S3 backups. To enable S3 backups `backup_s3_bucket`, `backup_s3_access_key` and `backup_s3_secret_key` have to be provided. | `string` | `null` | no |
| [backup\_s3\_host](#input\_backup\_s3\_host) | AWS host S3 backups. | `string` | `"s3.eu-central-1.amazonaws.com"` | no |
| [backup\_s3\_region](#input\_backup\_s3\_region) | AWS region for S3 backups. | `string` | `"eu-central-1"` | no |
| [backup\_s3\_retention\_diff](#input\_backup\_s3\_retention\_diff) | AWS S3 backup number of differential backups to retain. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-diff | `number` | `4` | no |
| [backup\_s3\_retention\_full](#input\_backup\_s3\_retention\_full) | AWS S3 backups full backup retention count/time. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-full | `number` | `7` | no |
| [backup\_s3\_retention\_full\_type](#input\_backup\_s3\_retention\_full\_type) | AWS S3 backups retention policy type [count, time]. See https://pgbackrest.org/configuration.html#section-repository/option-repo-retention-full | `string` | `"count"` | no |
| [backup\_s3\_secret\_key](#input\_backup\_s3\_secret\_key) | AWS secret key for S3 backups. To enable S3 backups `backup_s3_bucket` `backup_s3_access_key` and `backup_s3_secret_key` have to be provided. | `string` | `null` | no |
| [backup\_volume](#input\_backup\_volume) | backup volume id | `string` | `0` | no |
| [data\_volume](#input\_data\_volume) | data volume id | `number` | n/a | yes |
| [databases](#input\_databases) | A list of databases to create when the instance is initialized, for example: `{ id : "database1", user : "user1", password : "password1" }`. Changing `user` and `password` is supported at any time, the provided config is translated into an config for the Solidblocks RDS PostgreSQL module (https://pellepelster.github.io/solidblocks/rds/index.html), please see https://pellepelster.github.io/solidblocks/rds/index.html#databases for more details of the database configuration. | `list(object({ id : string, user : string, password : string }))` | n/a | yes |
| [db\_admin\_password](#input\_db\_admin\_password) | The database admin password. Username is always rds | `string` | `""` | no |
| [db\_backup\_gcs\_bucket](#input\_db\_backup\_gcs\_bucket) | Name of the Google Cloud storage bucket | `string` | `null` | no |
| [db\_backup\_gcs\_service\_key](#input\_db\_backup\_gcs\_service\_key) | content of the service key json file with appropriate permissions to write to the `db_backup_gcs_bucket` bucket. | `string` | `null` | no |
| [environment\_variables](#input\_environment\_variables) | A list environment variables to pass to the PostgreSQL docker container | `map(string)` | `{}` | no |
| [extra\_user\_data](#input\_extra\_user\_data) | deprecated, please use pre\_script/post\_script | `string` | `""` | no |
| [firewall\_disable](#input\_firewall\_disable) | disable automatic firewall configuration | `bool` | `false` | no |
| [labels](#input\_labels) | A list of labels to be attached to the server instance. | `map(any)` | `{}` | no |
| [location](#input\_location) | Hetzner location to use for provisioned resources | `string` | n/a | yes |
| [mode](#input\_mode) | startup mode for the database, can be empty to start the database or 'maintenance' to enable the maintenance mode of the underlying docker container to debug issues see also https://pellepelster.github.io/solidblocks//rds/#maintenance | `string` | `null` | no |
| [name](#input\_name) | Unique name for the PostgreSQL instance | `string` | n/a | yes |
| [network\_id](#input\_network\_id) | network the created sever should be attached to, network\_ip also needs to bet set in that case | `number` | `null` | no |
| [network\_ip](#input\_network\_ip) | ip address in the attached network. when an ip address is provided the database server will automatically be bound to this ip and will not be exposed on any other network interfaces | `string` | `null` | no |
| [post\_script](#input\_post\_script) | shell script that will be executed after the server configuration is executed | `string` | `""` | no |
| [postgres\_extra\_config](#input\_postgres\_extra\_config) | Extra postgres configurations options for the postgresql.conf, see also https://pellepelster.github.io/solidblocks/rds/index.html#global -> DB\_POSTGRES\_EXTRA\_CONFIG | `string` | `null` | no |
| [postgres\_major\_version](#input\_postgres\_major\_version) | PostgreSQL major version to use. Upgrading the version will trigger auto migration based on the underlying RDS PostgreSQL docker image, see also https://pellepelster.github.io/solidblocks/rds/index.html#versions. Please be aware that depending on the amount of data to migrate the migration may Terraforms timeouts, see https://pellepelster.github.io/solidblocks/hetzner/rds-postgresql/index.html#operations for debugging options. | `number` | `14` | no |
| [postgres\_stop\_timeout](#input\_postgres\_stop\_timeout) | shutdown timeout for the postgres database in seconds, see also https://www.postgresql.org/docs/current/app-pg-ctl.html | `number` | `60` | no |
| [pre\_script](#input\_pre\_script) | shell script that will be executed before the server configuration is executed | `string` | `""` | no |
| [public\_net\_ipv4\_enabled](#input\_public\_net\_ipv4\_enabled) | enable/disable public ip addresses, see also https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/server#public_net | `bool` | `true` | no |
| [public\_net\_ipv6\_enabled](#input\_public\_net\_ipv6\_enabled) | enable/disable public ip addresses, see also https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/server#public_net | `bool` | `true` | no |
| [restore\_pitr](#input\_restore\_pitr) | Point in time to recover to, using the recovery type `time` as defined in https://pgbackrest.org/command.html#command-restore. Format should be `YYYY-MM-dd HH:mm:ssz` Please be aware that the server hosting the database might be in a different timezone, so always include the timezone when specifying PITR times `date +"%Y-%m-%d %H:%M:%S%z"` | `string` | `null` | no |
| [server\_type](#input\_server\_type) | Hetzner cloud server type, supports x86 and ARM architectures | `string` | `"cx11"` | no |
| [solidblocks\_base\_url](#input\_solidblocks\_base\_url) | override base url for testing purposes | `string` | `"https://github.com"` | no |
| [solidblocks\_cloud\_init\_version](#input\_solidblocks\_cloud\_init\_version) | Solidblocks cloud-init version to use | `string` | `"v0.2.7"` | no |
| [solidblocks\_rds\_version](#input\_solidblocks\_rds\_version) | Solidblocks rds-postgresql version to use | `string` | `"v0.2.7"` | no |
| [ssh\_keys](#input\_ssh\_keys) | ssh keys to provision for instance access | `list(number)` | n/a | yes |
| [ssl\_acme\_server](#input\_ssl\_acme\_server) | The URL of the ACME Server to use. Defaults to Let's Encrypt production environment. | `string` | `"https://acme-v02.api.letsencrypt.org/directory"` | no |
| [ssl\_dns\_provider](#input\_ssl\_dns\_provider) | provider type to use for LetsEncrypt DNS challenge, see https://go-acme.github.io/lego/dns/ for available options | `string` | `""` | no |
| [ssl\_dns\_provider\_config](#input\_ssl\_dns\_provider\_config) | environment configuration variable(s) to use for DNS provider selected via `ssl_dns_provider`, see documentation of selected provider for required configuration variables | `map(string)` | `{}` | no |
| [ssl\_domains](#input\_ssl\_domains) | domains to use for generated certificates | `list(string)` | `[]` | no |
| [ssl\_email](#input\_ssl\_email) | email address to use for LetsEncrypt account creation | `string` | `""` | no |
| [ssl\_enable](#input\_ssl\_enable) | enable automatic ssl certificate creation using LetsEncrypt | `bool` | `false` | no |## Outputs
| Name | Description |
|------|-------------|
| [ipv4\_address](#output\_ipv4\_address) | IPv4 address of the created server if applicable |
| [ipv4\_address\_private](#output\_ipv4\_address\_private) | private IPv4 address of the created server if applicable |
| [ipv6\_address](#output\_ipv6\_address) | IPv6 address of the created server if applicable |
| [this\_server\_id](#output\_this\_server\_id) | Hetzner ID of the created server |
| [user\_data](#output\_user\_data) | n/a |