Skip to content

Conversation

@diofeher
Copy link

@diofeher diofeher commented Dec 9, 2025

Forking and adding support for dynamic provider evaluation.

I tested with the following config:

variable "clusters" {
  type    = list(string)
  default = ["cluster-1", "cluster-2", "cluster-3"]
}

provider "kubernetes" {
  for_each               = toset(var.clusters)
  alias                  = "kubernetes"
  host                   = "https://${module.kubernetes[each.key].cluster_endpoint}"
  cluster_ca_certificate = sensitive(base64decode(module.kubernetes[each.key].cluster_ca_certificate))
  token                  = sensitive(module.kubernetes[each.key].cluster_access_token)
}

module "service_account" {
  source   = "./service_account"
  for_each = module.kubernetes
  providers = {
    kubernetes = kubernetes.kubernetes[each.key]
  }
}

Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
@diofeher diofeher closed this Dec 9, 2025
@diofeher diofeher deleted the opentofu-initial branch December 9, 2025 11:45
@diofeher diofeher restored the opentofu-initial branch December 9, 2025 11:46
@diofeher diofeher deleted the opentofu-initial branch December 9, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant