Last active
December 2, 2019 23:52
-
-
Save phivid/a87881eda1b883d5bddce7a08123ef4f to your computer and use it in GitHub Desktop.
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
resource "null_resource" "install_autoscaler" { | |
depends_on = [aws_eks_node_group.example] | |
triggers = { | |
autoscaler_conf = tostring(data.template_file.autoscaler.rendered) | |
albingresscontroller_conf = tostring(data.template_file.albingresscontroller.rendered) | |
} | |
provisioner "local-exec" { | |
command = <<EOT | |
mkdir /home/terraform/.aws | |
# | |
# AWS cli configuration... | |
# | |
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
unzip awscli-bundle.zip | |
./awscli-bundle/install -b ~/bin/aws | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
mv ./kubectl ~/bin/kubectl | |
echo $PATH | grep ~/bin | |
export PATH=/home/terraform/bin:~/bin:$PATH | |
# | |
# Other AWS cli configuration to communicate with EKS... | |
# | |
/home/terraform/bin/kubectl apply -f /home/terraform/autoscaler.yml | |
/home/terraform/bin/kubectl apply -f /home/terraform/albingresscontroller.yml | |
EOT | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment