Last active
June 6, 2021 07:14
-
-
Save yogesh174/dadfef2496b6632a1d3a9b36e310dcec to your computer and use it in GitHub Desktop.
Multi-cloud K8s cluster with Terraform and Ansible
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
######################################### | |
######## 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