Script has been written for 1 master and multi worker setup. Adding multiple master will need changes in the scripts. This will create a VPC, subnets, private ips, security groups and other required aws resources . This will create cluster in ap-south-1, if you are creating in different region, please use the correct AMI.
Step:
1 - Install terraform and configure aws credentials using awscli aws configure --profile <profilename>
https://learn.hashicorp.com/tutorials/terraform/aws-build?in=terraform/aws-get-started
2 - git clone https://github.com/rk280392/terraform-aws-k8s.git
3 - cd terraform-aws-k8s
4 - terraform plan
5 - terraform apply
You can modify the script as you need.
List all instances created using the key-pair of terraform:
./aws-cli-scripts.sh list <profile-name>
Stop all instances listed by list command:
./aws-cli-scripts.sh stop <profile-name>
Start all instances listed by list command:
./aws-cli-scripts.sh start <profile-name>