terraform-aws-eks
This terraform module produces an AWS EKS cluster.
Requirements
Providers
Modules
Name |
Source |
Version |
eks |
terraform-aws-modules/eks/aws |
>=17.0.0, <18.0.0 |
vpc |
terraform-aws-modules/vpc/aws |
2.66.0 |
Resources
Inputs
Name |
Description |
Type |
Default |
Required |
domain_name_servers |
List of name servers to configure in /etc/resolv.conf. |
list(string) |
[ "AmazonProvidedDNS" ] |
no |
enable_dns_hostnames |
Needs to be true to have a functional EKS cluster; it enables DNS hostnames in the VPC. |
bool |
true |
no |
enable_dns_support |
Needs be true to have a functional EKS cluster; it enables DNS support in the VPC. |
bool |
true |
no |
enable_nat_gateway |
Should be true if you want to provision NAT Gateways for each of your private networks. |
bool |
true |
no |
region |
AWS region. |
string |
"eu-west-2" |
no |
single_nat_gateway |
Should be true if you want to provision a single shared NAT Gateway across all of your private networks. |
bool |
true |
no |
worker_groups_asg_desired_capacity |
Capacity of the auto-scaling group being used for the worker groups. |
number |
1 |
no |
worker_groups_instance_type |
Type of instance to be used for the worker groups. |
string |
"t2.small" |
no |
Outputs
Additional Information
Before running the Terraform scripts, make sure to set the IAM required permissions first. You will have to remove the comments in the code if you decide to copy/paste them. Remember it is a best practice to use a role and assign this permissions as a managed policy rather than inline.
Instructions
- Make sure you have the following installed and configured:
- AWS CLI
- AWS IAM Authenticator
- kubectl
- wget
- Set your working directory to: this directory
- Execute:
terraform init
- Execute:
terraform apply
- Confirm the apply with a:
yes
- Execute:
terraform apply
- At this point you can configure kubectl:
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
- What you decide to do next is up to you; the cluster is ready for you to work with it.
- Clean up:
terraform destroy