Skip to content

Instantly share code, notes, and snippets.

@yogesh174
Last active June 6, 2021 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogesh174/dadfef2496b6632a1d3a9b36e310dcec to your computer and use it in GitHub Desktop.
Save yogesh174/dadfef2496b6632a1d3a9b36e310dcec to your computer and use it in GitHub Desktop.
Multi-cloud K8s cluster with Terraform and Ansible
#########################################
######## Create k8s worker nodes ########
#########################################
resource "aws_instance" "k8s_worker" {
count = var.aws_nodes
ami = data.aws_ami.amazon_linux_2.image_id
instance_type = var.aws_instance_type
# Created after and destroyed before master node
depends_on = [
aws_instance.k8s_master,
]
tags = {
Name = "aws-k8s-worker-${count.index}"
}
key_name = aws_key_pair.terraform_k8s.key_name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment