-
-
Save pkolyvas/68a28feab28163ca46b5c9cdea87444a to your computer and use it in GitHub Desktop.
Terraform Progressive Apply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
kubeconfig_file = "${path.module}/kubeconfig" | |
} | |
provider "local" {} | |
# provider "kubernetes" { | |
# config_path = local.kubeconfig_file | |
# } | |
provider "kubernetes" { | |
config_path = local_file.kubeconfig.filename | |
} | |
resource "local_file" "kubeconfig" { | |
depends_on = [local_file.otherstuff] | |
filename = "${path.module}/kubeconfig" | |
content = file("~/.kube/config") | |
} | |
resource "local_file" "otherstuff" { | |
count = 10 | |
filename = "${path.module}/otherstuff.${count.index}" | |
content = file("~/.kube/config") | |
} | |
resource "kubernetes_config_map" "test" { | |
depends_on = [local_file.kubeconfig] | |
metadata { | |
name = "test" | |
} | |
data = { | |
"foo" = "bar" | |
} | |
} | |
output "locals_kubeconfig_file" { | |
value = local.kubeconfig_file | |
} | |
output "local_file_kubeconfig" { | |
value = local_file.kubeconfig.filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment