Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/niveshsunny/terraform-eks

I created my own EKS cluster within a VPC using Terraform, avoiding modules to gain more control over the infrastructure.
https://github.com/niveshsunny/terraform-eks

eks iaac terraform vpc

Last synced: 24 days ago
JSON representation

I created my own EKS cluster within a VPC using Terraform, avoiding modules to gain more control over the infrastructure.

Awesome Lists containing this project

README

        

# Terraform EKS Cluster in Private VPC

This project demonstrates the creation of an EKS cluster in a private VPC using Terraform. All resources, including VPC, subnets, route tables, NAT gateways, and the EKS cluster, were built from scratch without using pre-built Terraform modules.

## Features

- **EKS Cluster**: Provisioned using AWS EKS.
- **Private VPC**: Custom-built VPC with private subnets for enhanced security.
- **Subnets and Route Tables**: Handled manually to control traffic flow.
- **NAT Gateways**: Ensuring private access for instances in the private subnets.
- **IAM Roles and Policies**: Configured for EKS workers and control plane.

## Prerequisites

- AWS Account
- Terraform 1.x.x
- AWS CLI
- kubectl

## Usage

1. Clone the repository:

```bash
git clone https://github.com/niveshsunny/terraform-eks.git
cd terraform-eks
```

2. Initialize the project:

```bash
terraform init
```

3. Apply the configuration:

```bash
terraform apply
```

4. Update your kubeconfig to interact with the cluster:

```bash
aws eks --region update-kubeconfig --name
```

5. Verify your cluster:

```bash
kubectl get nodes
```

## Resources

- **VPC**: Custom-built VPC with private subnets.
- **EKS Cluster**: Created from scratch.
- **NAT Gateways**: Provisioned for internet access in the private subnets.
- **IAM Roles and Policies**: Configured for the EKS cluster.

## Architecture Diagram

![Alt text]( https://res.cloudinary.com/practicaldev/image/fetch/s--n_cbMy3c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cp8bxvvknzy6k7js7bi4.png)

## Notes

- This project does not use pre-built Terraform modules to maintain full control and customization.
- Ensure your AWS credentials are properly configured before applying the Terraform plan.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.