A sample repository to create EKS on AWS using Terraform.
As the first step, you need to install AWS CLI as we will use the AWS CL (aws configure) command to connect Terraform with AWS in the next steps.
Follow the below link to Install AWS CLI.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htmlNext, Install Terraform using the below link.
https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cliIts very easy to connect Terraform with AWS. Run aws configure command and provide the AWS Security credentials as shown in the video.
Clone the repository and Run terraform init. This will initialize the terraform environment for you and download the modules, providers and other configuration required.
- Run
terraform planto see the configuration it creates when executed. - To apply terraform configuration to create EKS cluster with VPC, run:
terraform apply
Once the cluster is created, use the following command to establish communication with the Kube-api server
aws eks update-kubeconfig --name <cluster-name> --region <region> --profile <default>