Skip to content

Added EKS Automode Feature #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Added EKS Automode Feature #76

wants to merge 8 commits into from

Conversation

ruchit-sharma09
Copy link

what

  • This PR implements automode functionality for AWS EKS clusters, allowing for automatic scaling of node groups based on workload demands.
  • Added a file aws-auth-auto-mode.tf to create access entry for automode.
  • Added separate Iam role for automode cluster and nodegroup in iam.tf.
  • Added some supporting resources in root main.tf file
  • Created some extra variables to support eks auto mode.

@ruchit-sharma09 ruchit-sharma09 changed the title Added EKS Automode Functionality Added EKS Automode Feature Apr 16, 2025
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows ALL ports. Error

Network ACL rule allows access using ALL ports.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows specific ports from /0. Error

Network ACL rule allows ingress from public internet.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows specific ports from /0. Error

Network ACL rule allows ingress from public internet.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows specific ports from /0. Error

Network ACL rule allows ingress from public internet.
Comment on lines 168 to 268
source = "clouddrove/subnet/aws"
version = "2.0.0"

name = "${local.name}-subnets"
environment = local.environment

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
igw_id = module.vpc.igw_id

extra_public_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}

extra_private_tags = {
"kubernetes.io/cluster/${module.eks.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}

public_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

public_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_inbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]

private_outbound_acl_rules = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
{
rule_number = 101
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
ipv6_cidr_block = "::/0"
},
]
}

Check failure

Code scanning / defsec

An ingress Network ACL rule allows specific ports from /0. Error

Network ACL rule allows ingress from public internet.
@h1manshu98 h1manshu98 marked this pull request as draft April 22, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant