/terraform-aws-eks

Highly opinionated Kubernetes management for AWS

Primary LanguageHCLMIT LicenseMIT

AWS kubernetes resources

Introduction

This module manages required AWS Kubernetes resources as EKS clusters.

Uses terraform-aws-modules/eks/aws for implementation.

Usage

Instantiate the module by calling it from Terraform like this:

module "aws-eks" {
  source = "dodevops/kubernetes/aws"
  version = "<version>"
  
  (...)
}

Requirements

The following requirements are needed by this module:

  • kubernetes (>=2.19.0)

Providers

The following providers are used by this module:

  • aws

Modules

The following Modules are called:

eks

Source: terraform-aws-modules/eks/aws

Version: 19.10.0

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

aws-auth-map-roles

Description: Desired content of the aws-auth configmap

Type: list(any)

k8s_version

Description: Kubernetes version to use for the EKS cluster.

Type: string

nodegroups

Description: List of Nodegroup configurations

  • suffix: Nodegroup name suffix
  • subnet_ids: Ids of used subnets in the nodegroup
  • scaling: Scaling configuration
    • desired: Desired number of nodes
    • min: Minimum number of nodes
    • max: Maximum number of nodes
  • disk_size: Disk size in GB
  • instance_type: Instance type of the nodes}

Type:

list(object({
    suffix : string,
    subnet_ids : list(string),
    scaling : object({
      min : number,
      max : number,
      desired : number
    }),
    disk_size : number,
    instance_type : string
  }))

project

Description: Project this configuration is for

Type: any

stage

Description: Name of the stage for this state

Type: string

subnet_cidrs

Description: List of IDs of subnets to use in the EKS

Type: list(string)

subnet_ids

Description: List of IDs of subnets to use in the EKS

Type: list(string)

vpc_id

Description: ID of the VPC the cluster is in

Type: string

Optional Inputs

No optional inputs.

Outputs

The following outputs are exported:

ca_certificate

Description: CA certificate of the EKS endpoint

host

Description: EKS cluster endpoint

oidc_provider

Description: OIDC provider used by the EKS

token

Description: Auth token for the EKS endpoint

Development

Use terraform-docs to generate the API documentation by running

terraform fmt .
terraform-docs .