Creating the cluster infrastructure
In this section, you will develop the following Terraform modules:
- An EKS module
- A Kubernetes worker module
- A Kubernetes cluster module that wraps both the EKS control plan and the workers
After that, you will use these modules to Terraform your first cluster, Packt cluster
, and then provision it in your AWS account.
Developing the EKS Terraform module
Under the terraform/modules
directory, create a subdirectory with the name eks-cp
. This directory will contain the following Terraform source code files for the EKS control plane module:
variables.tf
main.tf
security-groups.tf
iam.tf
outputs.tf
The previous list of files together comprises the EKS Terraform module. You will learn about each of these code and configuration files in the following subsections.
Input variables
The variables.tf
file defines the input variables that are accepted in the EKS module. The module user should provide...