Skatteetaten / terraform-nomad-postgres

Apache License 2.0
8 stars 5 forks source link

Update to Terraform >1.0 and expand customization options #81

Open neomantra opened 1 year ago

neomantra commented 1 year ago

I've been using this module to stand up TimescaleDB on Nomad. It's been super helpful!

But the current code is outdated -- it doesn't work out-of-the-box with modern Terraform (> 1.0 or maybe even >0.13). There were also some templating bugs with some of the array variables that I fixed (mostly by using jsonencode).

I also added customization points that I needed (no Connect, static ports, customize the launch), or otherwise were simple and made sense to add.

What was added/changed/fixed?

I summarized the changes in the CHANGELOG and labeled it 0.5.0:

### Changed
- Updated to work with Terraform >1.0
- Fixed `consul_tags` rendering of multiple tags
- Fixed `nomad_datacenters` rendering of multiple datacenters
- `nomad_datacenters` now defaults to the Nomad default of `["*"]`
- Port assignments are now done via the `network` stanza instead of `service` stanza
- Less extraneous whitespace in the generated Nomad job file

### Added
- Added `container_entrypoints`, `container_command`, and `container_command_args` to customize container launch
- Added `use_static_port` to make the `container_port` be a static port
- Added `use_connect` to make Consul Connect optional, default to `true` for backwards compatibility

Checklist (after created PR)