Recently, I was setting up a Kubernetes ingress using Terraform, and faced the case when based on an input variable I have to add a new annotation to the ingress configuration or not.

In my use case, I had to specify a security group to be attached to the Load Balancer created by the ingress controller. The thing was that I also wanted an easy way to remove the security group, without changing the Terraform code.

Searching the web, I came across this Reddit post, but the solution proposed by the user Bitflight was not what I really wanted, so…

Andrei Butnaru

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store