This terraform module produces an AWS EKS cluster.
Name | Version |
---|---|
terraform | ~> 1.0 |
aws | 3.63.0 |
kubernetes | 2.6.1 |
local | 2.0.0 |
null | 3.0.0 |
random | 3.0.0 |
template | 2.2.0 |
Name | Version |
---|---|
aws | 3.63.0 |
random | 3.0.0 |
Name | Source | Version |
---|---|---|
eks | terraform-aws-modules/eks/aws | >=17.0.0, <18.0.0 |
vpc | terraform-aws-modules/vpc/aws | 2.66.0 |
Name | Type |
---|---|
aws_kms_key.eks | resource |
aws_security_group.all_workers | resource |
aws_security_group.worker_group_one | resource |
aws_security_group.worker_group_two | resource |
aws_vpc_dhcp_options.dns_resolver | resource |
aws_vpc_dhcp_options_association.dns_resolver | resource |
random_string.suffix | resource |
aws_availability_zones.available | data source |
aws_eks_cluster.cluster | data source |
aws_eks_cluster_auth.cluster | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
domain_name_servers | List of name servers to configure in /etc/resolv.conf. | list(string) |
[ |
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 |
Name | Description |
---|---|
cluster_endpoint | Endpoint for EKS control plane. |
cluster_name | EKS cluster Name. |
k8s_cluster_name | Kubernetes cluster name. |
cluster_security_group_id | Security group IDs attached to the cluster control plane. |
config_map_aws_auth | A Kubernetes configuration to authenticate to this EKS cluster. |
kubectl_config | kubectl config as generated by the module. |
region | AWS region. |
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.
- 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