Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

connection {
host = self.public_ip
type = "ssh"
user = "ubuntu"
password = ""
private_key = "${file("<pem file path>")}"
}


main.tf file

The first step to using Terraform is typically to configure the provider(s) you want to use. The template is already configured using the environment variables. 

...

To create a worker node, only the worker node's user data changes. The user data should be configured to read the microk8s join token from the local data store. This joins the worker node with the master node. 


Variables.tf file
The provider and the resource blocks in the main.tf file can be configured by changing the values in variables.tf file.
For example, if you want to change the aws_instace type from t2.small to t2.micro, set the TF_VAR with the appropriate values. 

Other resource-specific values like aws_region, aws_ami, vpc_id and the subnet can also be changed the same way by editing the respective TF_VAR environment variables. 


Apply terraform

To create a master node with microk8s, run the following commands.
terraform init
terraform plan
terraform apply

...