• terraform: Refresh null_resource when a variable changes

    2 min read

    terraform triggers null_resource local-exec

    When using local-exec with the null_resource we might need to be able to update the resources that gets created like this. Let's assume we have the following terraform code to apply Kustomize to a kubernetes cluster:

    resource "null_resource" "metrics-server" {
      provisioner "local-exec" {
        command = "kubectl apply -k 'https://github.com/jordiprats/django-ampa/deploy-${var.version}/'"
      }
    }
    

    Given this setup even though the var.version changed, the resource won't be updated if it was already applied

    08/03/2021

    Read more...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets