-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I found this provider when I was looking for a simple-ish way to take an existing Kubernetes manifests and customise them a little based on some terraform parameters, e.g. insert environment variables.
My key requirements is that the given Kubernetes manifests is sourced from somewhere and forking it or making a change upstream is not viable. I also don't want to shell out to kustomize or other tools for this purpose, at least for the simple thing I need to get done.
I tried using Terraform merged function, until I realise it's only a shallow merge. I found this provider and realised that it generally fits the bill. I really like it and appreciate the work put into it.
Here are a few things I thought I should share with the author:
- including a YAML parser might be quite handy
- passing Terraform objects as variables results in all attributes being read-only
- using
_.clonedoesn't solve that - it's possible to add new properties, but still not possible to update an existing property
- using
To do what I had to do, I ended up passing an object as JSON data (re-encoded from YAML source by Terraform), and parsing it in JavaScript. It's a bit inconvenient/unintuitive, I wished to be able to modify the object directly (having to copy is fine, of course).