GalleyBytes / terraform-operator

A Kubernetes CRD to handle terraform operations
http://tf.galleybytes.com
Apache License 2.0
364 stars 47 forks source link

parse customBackend for kubernetes to assign roles #4

Closed isaaguilar closed 3 years ago

isaaguilar commented 3 years ago

As mentioned in #3, the "kubernetes" backend type, albeit not the default backend, can now be used with terraform-operator by automatically detecting the backend type and assigning the correct roles to it.

So a spec like this generates a role with access to secrets, leases in addition to configmaps.

spec:
  # ...
  customBackend: |-
    terraform {
      backend "kubernetes" {
        secret_suffix    = "state"
        in_cluster_config  = true
      }
    }