https://www.terraform.io/downloads.html
- Change "YOUR_KEY_NAME_HERE" to your ssh keyname (assumes it's already uploaded)
- Update the AWS region as desired (make sure your ssh key is in this region)
- Add your AWS "access key" and "aws_secret_key" to this file (NOT RECOMENDED). Terraform will use ~/.aws/credentials if not specified in the .tf file. (RECOMENDED)
- Run
terraform init
- Run
terraform plan
- Run
terraform apply
If your IP Address changes, and you lose access to ssh into your hosts, just run terraform apply
again and the security group will be updated with your new IP Address.
If you don't know how to create and upload a key pair to aws, see here. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
- Run
terraform destroy
- Added
aws_ec2_tag
resources to tag spot instances, as spot request api doesn't tag instances - Added helper script to get an Ansible inventory:
./ansible-inventory.sh >../ansible-k8s-setup-kubeadm/inventory
- ...