canonical / canonical/postgresql-operator
Support for exposing endpoints and simplified single-VM deployment in PostgreSQL Terraform module
- Dominant language
- Python
- Stars
- 20
- Forks
- 36
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 30
Description
## Steps to reproduce
I worked using your terraform modules in a project and wanted to share a couple of enhancements that could make it more flexible and easier to integrate with different types of deployments.
There is currently no exposed way to configure the endpoint bindings through a variable in the module. I modified the module manually adding this:
endpoint_bindings = [{
space = var.postgresql_space
},{
endpoint = "cos-agent"
space = var.oam_space
}]
Also, the current module seems to be optimized for an HA deployment using units, which is great. However, some edge or test environments benefit from running PostgreSQL in a single VM with explicit machine placement.
To achieve this, I had to define a separate juju_machine resource and attach it like so:
```
resource "juju_machine" "postgresql" {
model = var.juju_model_name
base = "ubuntu@22.04"
name = var.placement
constraints = var.constraints
}
resource "juju_application" "machine_postgresql" {
...
machines = [juju_machine.postgresql.machine_id]
}
```
It would also help to define clear patterns to use integrations. Right now I have created each integration manually.
## Expected behavior
Have endpoint_bindings as a variable.
Have use_machine toggle to enable single VM deployments.
Have a way to integrate this module efficiently and have documentation on how to integrate between modules (could be specifically for the HA/single)
## Versions
juju terraform provider 0.19.0
Contributor guide
Assessment
This issue has not been assessed yet.