f5devcentral / terraform-bigip-app-consul-sync-nia

This terraform module leverages consul-terraform-sync to create and update application services on BIG-IP based on registered services within Consul
MIT License
4 stars 7 forks source link

Support ability to feed in as3 template location on first run #11

Open npearce opened 3 years ago

npearce commented 3 years ago

From the perspective of automation pipeline resilience, whereby, for example, consul+consul-terraform-sync are both running in a nuke-able container/VM, there would be a need to provide a location reference to the custom AS3 templates.

As the terraform BIG-IP AS3 consul-terraform-sync module doesn't exist before the first run, when consul-terraform-sync executes a terraform init to download the modules, there needs to be an existing location to pull templates from. This path exists only after the modules has been installed.

https://github.com/f5devcentral/terraform-bigip-app-consul-sync-nia/blob/caea24df75777fdcea038683661ead1cd42987e9/main.tf#L12

Something like: var.as3template_path with a default of the consul-terraform-sync "working_dir" if none specified... or something like that.

nmenant commented 3 years ago

Thanks Nathan for your feedback.

Tracking this internally with TER-502

npearce commented 3 years ago

Building a BIG-IP + consul-terraform-sync lab on our Instruqt platform, so needing to automate the creation of the tooling. Nuke it all! Then nuke it again!!! :)

focrensh commented 3 years ago

Glad to see you jump on this so quickly! This limitation had plans to be dynamic in future releases. We had a version working that was using KV within consul itself to host the templates as well. I like the PATH var idea.

npearce commented 3 years ago

The path var means I can pull the AS3 templates from version control - maintained out of band of the tooling.

The Consul k/v store idea would be cool for orgs that have looser operational demarcation between Consul and Network Infrastructure. Some aren't there yet. You can do both (path first)!!! ;)

nmenant commented 3 years ago

In one of our latest update we added a new variable :

variable "as3template_path"

This should help address your use case. It's here: https://github.com/f5devcentral/terraform-bigip-app-consul-sync-nia/blob/master/variables.tf