Skip to content

Commit de418b5

Browse files
authored
feb-08 infra setup vpc (#13)
1 parent fcf483d commit de418b5

File tree

11 files changed

+96
-0
lines changed

11 files changed

+96
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module "eks" {
2+
source = "terraform-aws-modules/eks/aws"
3+
cluster_name = var.cluster_name
4+
cluster_version = "1.30"
5+
subnets = var.subnet_ids
6+
vpc_id = var.vpc_id
7+
8+
node_groups = {
9+
default = {
10+
desired_capacity = var.desired_capacity
11+
max_capacity = var.max_size
12+
min_capacity = var.min_size
13+
14+
instance_type = var.node_instance_type
15+
}
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
output "cluster_id" {
2+
description = "The ID of the EKS cluster"
3+
value = module.eks.cluster_id
4+
}
5+
6+
output "cluster_endpoint" {
7+
description = "The endpoint of the EKS cluster"
8+
value = module.eks.cluster_endpoint
9+
}
10+
11+
output "cluster_arn" {
12+
description = "The ARN of the EKS cluster"
13+
value = module.eks.cluster_arn
14+
}
15+
16+
output "kubeconfig" {
17+
description = "Kubeconfig file contents for the cluster"
18+
value = module.eks.kubeconfig
19+
}
20+
21+
output "node_group_names" {
22+
description = "Names of the node groups created"
23+
value = module.eks.node_groups
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
provider "aws" {
2+
region = var.region
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
variable "region" {
2+
description = "The AWS region to deploy EKS cluster"
3+
type = string
4+
default = "us-west-2"
5+
}
6+
7+
variable "cluster_name" {
8+
description = "The name of the EKS cluster"
9+
type = string
10+
default = "my-eks-cluster"
11+
}
12+
13+
variable "node_group_name" {
14+
description = "The name of the EKS node group"
15+
type = string
16+
default = "eks-node-group"
17+
}
18+
19+
variable "node_instance_type" {
20+
description = "The EC2 instance type for the nodes"
21+
type = string
22+
default = "t3.medium"
23+
}
24+
25+
variable "desired_capacity" {
26+
description = "The desired number of worker nodes"
27+
type = number
28+
default = 2
29+
}
30+
31+
variable "min_size" {
32+
description = "The minimum number of worker nodes"
33+
type = number
34+
default = 1
35+
}
36+
37+
variable "max_size" {
38+
description = "The maximum number of worker nodes"
39+
type = number
40+
default = 3
41+
}
42+
43+
variable "vpc_id" {
44+
description = "The ID of the VPC"
45+
type = string
46+
}
47+
48+
variable "subnet_ids" {
49+
description = "The IDs of the subnets"
50+
type = list(string)
51+
}

infrastructure/terragrunt/terragrunt.hcl

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include "root" {
77
path = find_in_parent_folders()
88
}
99

10+
1011
# Specify inputs for the VPC module
1112
inputs = {
1213
aws_region = "us-east-1"

0 commit comments

Comments
 (0)