Skip to content

Terraform module to deploy an auto scaling baked EKS on AWS with windows container support

Notifications You must be signed in to change notification settings

chtbks/devops-terraform-aws-eks-windows

 
 

Repository files navigation

EKS with Windows Terraform module

ci workflow Terraform module to deploy EKS with Windows support

Requirements

Name Version
terraform >= 1.4.5
aws 4.60.0
helm 2.9.0
kubernetes 2.19.0

Providers

No providers.

Inputs

Name Description Type Default Required
aws_region Region to deploy EKS Cluster into string "us-east-1" no
eks_autoscaling_group_linux_desired_capacity Desired capacity for Linux nodes for the EKS. number 1 no
eks_autoscaling_group_linux_max_size Minimum number of Linux nodes for the EKS. number 2 no
eks_autoscaling_group_linux_min_size Minimum number of Linux nodes for the EKS. number 1 no
eks_autoscaling_group_windows_desired_capacity Desired capacity for Windows nodes for the EKS. number 1 no
eks_autoscaling_group_windows_max_size Maximum number of Windows nodes for the EKS. number 2 no
eks_autoscaling_group_windows_min_size Minimum number of Windows nodes for the EKS number 1 no
eks_cluster_name Name for the EKS Cluster string "eks" no
eks_cluster_version Kubernetes version for the EKS cluster string "1.26" no
eks_instance_type Instance size for EKS worker nodes. string "m5.large" no
eks_users Additional AWS users to add to the EKS aws-auth configmap.
list(object({
userarn = string
username = string
groups = list(string)
}))
[] no
enable_cloudwatch_exported Enable cloudwatch exporter bool true no
enable_cluster_autoscaler Enable cluster autoscaler bool true no
enable_loadbalancer_controler Enable ALB load Balancer controller bool true no
enable_metrics_server Install metrics server into the cluster bool true no
external_dns_support Setup IAM, service accoutn and cluster role for external_dns in EKS bool false no
windows_ami_type AMI type for the Windows Nodes. string "WINDOWS_CORE_2022_x86_64" no

Outputs

Name Description
eks_cluster_certificate_authority_data EKS cluster CA
eks_cluster_endpoint EKS cluster endpoint
eks_cluster_name EKS cluster ID
kubeconfig kubeconfig for the AWS EKS cluster
private_subnet_ids List of private subnets that contain backend infrastructure (RDS, ElastiCache, EC2)
public_subnet_ids List of public subnets that contain frontend infrastructure (ALB)
vpc_id Id for the VPC created for CTFd

Examples

Simple

terraform {
  required_version = ">= 1.4.5"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "4.60.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

module "eks_windows" {
  source = "../../" # Actually set to "1nval1dctf/eks-windows/aws"
}

Building / Contributing

Install prerequisites

Golang

wget https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz
rm go1.19.5.linux-amd64.tar.gz

Terraform

LATEST_URL=$(curl https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url | select(.|test("alpha|beta|rc")|not) | select(.|contains("linux_amd64"))' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1)
curl ${LATEST_URL} > /tmp/terraform.zip
(cd /tmp && unzip /tmp/terraform.zip && chmod +x /tmp/terraform && sudo mv /tmp/terraform /usr/local/bin/)

Pre-commit and tools

Follow: https://github.com/antonbabenko/pre-commit-terraform#how-to-install

Run tests

Default tests will deploy to AWS.

make

⚠️ Warning: This will spin up EKS and other services in AWS which will cost you some money.

About

Terraform module to deploy an auto scaling baked EKS on AWS with windows container support

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 86.2%
  • Go 10.9%
  • Makefile 2.9%