Skip to content

Commit

Permalink
remove key pair
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jul 5, 2022
1 parent 8413aac commit 9aa6eb4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module "eks_cluster" {
kubernetes_version = var.kubernetes_version
allowed_security_groups = var.allowed_security_groups_cluster
workers_security_group_ids = [module.eks_workers.security_group_id]
workers_security_group_count = 1
workers_security_group_count = var.workers_security_group_count
allowed_cidr_blocks = var.allowed_cidr_blocks_cluster
enabled_cluster_log_types = var.enabled_cluster_log_types
public_access_cidrs = var.public_access_cidrs
Expand Down
3 changes: 1 addition & 2 deletions modules/node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "aws_eks_node_group" "default" {

launch_template {
name = each.value.node_group_name
version = 1
version = each.value.launch_template_version
}

depends_on = [aws_launch_template.default]
Expand All @@ -87,7 +87,6 @@ resource "aws_launch_template" "default" {
name = each.value.node_group_name
update_default_version = true
image_id = var.ami_release_version
key_name = var.key_name

dynamic "tag_specifications" {
for_each = var.resources_to_tag
Expand Down
1 change: 1 addition & 0 deletions modules/node-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ variable "node_groups" {
node_group_min_size = number
node_group_capacity_type = string
node_group_volume_type = string
launch_template_version = number
}))
}

Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ variable "cpu_utilization_high_threshold_percent" {
description = "Worker nodes AutoScaling Group CPU utilization high threshold percent."
}

variable "workers_security_group_count" {
type = number
default = 0
description = "Count of the worker Security Groups. Needed to prevent Terraform error `count can't be computed`."
}

variable "cpu_utilization_low_threshold_percent" {
type = number
default = 20
Expand Down Expand Up @@ -557,6 +563,7 @@ variable "node_groups" {
node_group_min_size = number
node_group_capacity_type = string
node_group_volume_type = string
launch_template_version = number
}))
default = {
tools = {
Expand All @@ -572,6 +579,7 @@ variable "node_groups" {
node_group_min_size = 1
node_group_capacity_type = "ON_DEMAND"
node_group_volume_type = "gp2"
launch_template_version = 1
}
}
}
Expand Down

0 comments on commit 9aa6eb4

Please sign in to comment.