This repository contains Terraform configurations for deploying an Amazon Elastic Kubernetes Service (EKS) cluster using Fargate. The configuration also defines the remote state backend used to store Terraform state.
eks-infra/base– Creates the S3 bucket and DynamoDB table used for Terraform remote state locking.eks-infra/– Terraform code to deploy the EKS cluster and associated resources.backend.tf– Points Terraform to the remote state backend.provider.tf– AWS and Kubernetes provider configuration.iam.tf– IAM roles for the EKS control plane and Fargate pod execution.vpc.tf– References an existing VPC and its subnets.main.tf– Creates the EKS cluster and two Fargate profiles (defaultandkube-system).variables.tf– Input variables such as region, cluster name and VPC ID.
- Terraform 1.0 or later.
- An AWS account with permissions to create IAM roles, EKS clusters and Fargate profiles.
- An existing VPC identified by
vpc_id(defaults tovpc-0e2be188a28d61ff7). - An S3 bucket (
gsti-backend) and DynamoDB table (gsti) for storing Terraform state. These can be created using the configuration ineks-infra/base. - AWS credentials configured locally (for example with the AWS CLI).
- (Optional) Create the remote state backend:
cd eks-infra/base terraform init terraform apply - Deploy the EKS cluster:
cd ../ terraform init terraform apply
This will create an EKS cluster with Fargate enabled for the default and kube-system namespaces.