finos / terraform-aws-cfi-eks

Apache License 2.0
0 stars 1 forks source link

FINOS - Incubating website build

terraform-aws-eks

This terraform module produces an AWS EKS cluster.

Requirements

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

Providers

Name Version
aws 3.63.0
random 3.0.0

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

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

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

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.

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

  1. Make sure you have the following installed and configured:
    • AWS CLI
    • AWS IAM Authenticator
    • kubectl
    • wget
  2. Set your working directory to: this directory
  3. Execute:
    terraform init
  4. Execute:
    terraform apply
  5. Confirm the apply with a:
    yes
  6. Execute:
    terraform apply
  7. At this point you can configure kubectl:
    aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
  8. What you decide to do next is up to you; the cluster is ready for you to work with it.
  9. Clean up:
    terraform destroy