Terraform demo with minikube

foo@bar:~$ brew install terraform
foo@bar:~$ vim ./main.tf
provider "helm" {
  kubernetes {
    config_context_cluster   = "minikube"
    config_path = "~/.kube/config"
  }
}

resource "helm_release" "my-helm-mongo" {
  name       = "my-mongodb"
  repository = "https://charts.bitnami.com/bitnami"
  chart      = "mongodb"
}
foo@bar:~$ minikube start
foo@bar:~$ terraform init
foo@bar:~$ terraform plan -out myplan
foo@bar:~$ terraform apply ./myplan

Make some changes

foo@bar:~$ helm delete my-mongodb

detect configuration drift

foo@bar:~$ terraform refresh
foo@bar:~$ terraform plan -out myplan
foo@bar:~$ terraform apply ./myplan

Cleanup

foo@bar:~$ terraform destroy