Skip to content

Commit

Permalink
feat: additional tags for public and private subnets (#58)
Browse files Browse the repository at this point in the history
* feat: additional tags for public and private subnets

* fix: removed tags attribute from subnet module
  • Loading branch information
h1manshu98 committed Sep 13, 2023
1 parent 6326463 commit 9b4604d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
10 changes: 10 additions & 0 deletions _example/aws_managed/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ module "subnets" {
ipv6_cidr_block = module.vpc.ipv6_cidr_block
enable_ipv6 = false

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

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

public_inbound_acl_rules = [
{
rule_number = 100
Expand Down
10 changes: 10 additions & 0 deletions _example/aws_managed_with_fargate/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ module "subnets" {
ipv6_cidr_block = module.vpc.ipv6_cidr_block
enable_ipv6 = false

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

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

public_inbound_acl_rules = [
{
rule_number = 100
Expand Down
11 changes: 10 additions & 1 deletion _example/complete/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module "subnets" {

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

nat_gateway_enabled = true
availability_zones = ["${local.region}a", "${local.region}b"]
Expand All @@ -44,6 +43,16 @@ module "subnets" {
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
Expand Down
12 changes: 11 additions & 1 deletion _example/self_managed/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,24 @@ module "subnets" {

name = "${local.name}-subnets"
environment = local.environment
tags = local.tags
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
Expand Down

0 comments on commit 9b4604d

Please sign in to comment.