rickardgranberg / terraform-provider-vaultoperator

Terraform Provider for Vault Operator operations
Mozilla Public License 2.0
19 stars 11 forks source link

FEAT: support aws eks get-token instead of kubeconfig #15

Closed ElfoLiNk closed 1 year ago

ElfoLiNk commented 1 year ago

Would be good to support something like the kubernetes provider does for aws eks config:

  host                   = module.eks.cluster_endpoint
  cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)

  exec {
    api_version = "client.authentication.k8s.io/v1beta1"
    command     = "aws"
    args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
  }

Like helm provider is doing:

provider "helm" {
  kubernetes {
    host                   = var.cluster_endpoint
    cluster_ca_certificate = base64decode(var.cluster_ca_cert)
    exec {
      api_version = "client.authentication.k8s.io/v1beta1"
      args        = ["eks", "get-token", "--cluster-name", var.cluster_name]
      command     = "aws"
    }
  }
}
rickardgranberg commented 1 year ago

I don't actively maintain this provider anymore, nor do I have the proper AWS environment to test this. I will accept a PR if you're so inclined.