Created
June 7, 2021 04:35
-
-
Save rdalbuquerque/48fd35b5aba3eb368f8bc14c301ec698 to your computer and use it in GitHub Desktop.
Terraform resource to fetch kubeconfig from newly created cluster
This file contains hidden or 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
resource "null_resource" "fetch_kubeconfig" { | |
provisioner "local-exec" { | |
command = "scp -i ~/.ssh/k8s-lab.pem admin@${aws_instance.kube_master.public_ip}:~/.kube/config ~/.kube/config && sed -i '/server/c\\ server: https://${aws_instance.kube_master.public_ip}:6443' ~/.kube/config" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment