This repository contains Terraform code for provisioning EKS infrastructure using AWS provider. Enable Fargate or Nodegroup as you wish by setting boolean values in enable_fargate/enable_nodegroup in variable.tf
Before running the Terraform code, you will need to:
- Have Terraform installed locally.
- Set up AWS credentials with necessary permissions to create and manage resources.
- Install the following Terraform providers:
local
> 2.3.0tls
> 4.0.4aws
> 4.53.0
To use this Terraform code:
- Update your AWS key id and access key in credentials file
- Clone and set boolean values to enable_fargate/enable_nodegroup in
variable.tf
- Execute the Terraform
- Execute the shell script (files/config_nodegroup.sh or files/config_fargate.sh) to configure the cluster
Variable Name | Description | Type | Default Value |
---|---|---|---|
enable_fargate | Set true to enable Fargate for the EKS cluster | bool | true |
enable_nodegroup | Set true to enable Nodegroup for the EKS cluster | bool | false |
nodegroup_scaling_config_options | Pass Nodegroup scaling configs for the EKS cluster. This variable is valid only if enable_nodegroup is true. | map(any) | { desired_size = 3, max_size = 5, min_size = 3 } |
region | The AWS region where the EKS cluster will be created. | string | us-west-2 |
cluster_name | The name of the EKS cluster to be created. | string | tf_eks_fargate |
environment | The environment where the EKS cluster will be created. | string | POC |