Skip to content

Commit 2d452be

Browse files
Added parameter for instance type (#91)
* Added parameter for instance type See #89. Added a variable to change the default instance type for the EKS Cluster * Added additional parameters for size and version
1 parent e68a930 commit 2d452be

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

docs/helpers/new-eks-cluster.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ Specify the AWS Region where the resources will be deployed:
3232
export TF_VAR_aws_region=xxx
3333
```
3434

35+
### 3. Instance Type
36+
37+
Depending on your region or limitations in your account, you might need to change to a different instance type.
38+
To do this, you can define the instance type to use:
39+
```bash
40+
export TF_VAR_managed_node_instance_type=xxx
41+
```
42+
43+
### 4. Anazon Elastic Kubernetes Service (Amazon EKS) Version
44+
45+
You can override the version of the cluster also:
46+
```bash
47+
export TF_VAR_eks_version=xxx
48+
```
49+
50+
3551
## Deploy
3652

3753
Simply run this command to deploy the example

examples/eks-cluster-with-vpc/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ module "eks_blueprints" {
4444
source = "github.com/aws-ia/terraform-aws-eks-blueprints?ref=v4.13.1"
4545

4646
cluster_name = local.cluster_name
47-
cluster_version = "1.24"
47+
cluster_version = var.eks_version
4848

4949
vpc_id = module.vpc.vpc_id
5050
private_subnet_ids = module.vpc.private_subnets
5151

5252
managed_node_groups = {
5353
mg_5 = {
5454
node_group_name = "managed-ondemand"
55-
instance_types = ["t3.xlarge"]
56-
min_size = 2
55+
instance_types = [var.managed_node_instance_type]
56+
min_size = var.managed_node_min_size
5757
subnet_ids = module.vpc.private_subnets
5858
}
5959
}

examples/eks-cluster-with-vpc/variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@ variable "aws_region" {
77
description = "AWS Region"
88
type = string
99
}
10+
variable "managed_node_instance_type" {
11+
description = "Instance type for the cluster managed node groups"
12+
type = string
13+
default = "t3.xlarge"
14+
}
15+
variable "managed_node_min_size" {
16+
description = "Minumum number of instances in the node group"
17+
type = number
18+
default = 2
19+
}
20+
variable "eks_version" {
21+
type = string
22+
description = "EKS Cluster version"
23+
default = "1.24"
24+
}

0 commit comments

Comments
 (0)