You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the introduction of subnet-specific EKS tag variables, you can now apply different tags to different subnet types. This is useful when you need specific tags for different subnet types for EKS cluster requirements or organizational purposes.
210
+
211
+
```hcl
212
+
module "vpc" {
213
+
vpc_cidr = "172.1.1.0/25"
214
+
215
+
# General EKS cluster tags applied to all subnets
216
+
eks_cluster_tags = {
217
+
"kubernetes.io/cluster/my-cluster" = "shared"
218
+
}
219
+
220
+
# Public subnet specific EKS tags
221
+
eks_public_subnet_tags = {
222
+
"kubernetes.io/cluster/my-cluster" = "owned"
223
+
"Environment" = "production"
224
+
}
225
+
226
+
# Private subnet specific EKS tags
227
+
eks_private_subnet_tags = {
228
+
"kubernetes.io/cluster/my-cluster" = "owned"
229
+
"Tier" = "application"
230
+
}
231
+
232
+
# Intra subnet specific EKS tags
233
+
eks_intra_subnet_tags = {
234
+
"Tier" = "management"
235
+
}
236
+
237
+
public_subnets = ["172.1.1.0/27"]
238
+
private_subnets = ["172.1.1.32/27"]
239
+
intranet_subnets = ["172.1.1.64/27"]
240
+
database_subnets = ["172.1.1.96/27"]
241
+
number_of_azs = 2
242
+
}
243
+
```
244
+
245
+
**Note**: The subnet-specific tags are merged with the general `eks_cluster_tags`, so you don't need to repeat common tags across all subnet types.
246
+
207
247
<!-- BEGIN_TF_DOCS -->
208
248
## Requirements
209
249
@@ -359,6 +399,10 @@ No requirements.
359
399
| <aname="input_default_vpc_name"></a> [default\_vpc\_name](#input\_default\_vpc\_name)| Name to be used on the Default VPC |`string`|`null`| no |
360
400
| <aname="input_default_vpc_tags"></a> [default\_vpc\_tags](#input\_default\_vpc\_tags)| Additional tags for the Default VPC |`map(string)`|`{}`| no |
361
401
| <aname="input_eks_cluster_tags"></a> [eks\_cluster\_tags](#input\_eks\_cluster\_tags)| List of tags that EKS will create, but also added to VPC for persistency across terraform applies |`map(any)`|`{}`| no |
402
+
| <aname="input_eks_database_subnet_tags"></a> [eks\_database\_subnet\_tags](#input\_eks\_database\_subnet\_tags)| Additional EKS-specific tags to apply to database subnets only |`map(any)`|`{}`| no |
403
+
| <aname="input_eks_intra_subnet_tags"></a> [eks\_intra\_subnet\_tags](#input\_eks\_intra\_subnet\_tags)| Additional EKS-specific tags to apply to intra subnets only |`map(any)`|`{}`| no |
404
+
| <aname="input_eks_private_subnet_tags"></a> [eks\_private\_subnet\_tags](#input\_eks\_private\_subnet\_tags)| Additional EKS-specific tags to apply to private subnets only |`map(any)`|`{}`| no |
405
+
| <aname="input_eks_public_subnet_tags"></a> [eks\_public\_subnet\_tags](#input\_eks\_public\_subnet\_tags)| Additional EKS-specific tags to apply to public subnets only |`map(any)`|`{}`| no |
362
406
| <aname="input_enable_flow_log"></a> [enable\_flow\_log](#input\_enable\_flow\_log)| Whether or not to enable VPC Flow Logs |`bool`|`false`| no |
363
407
| <aname="input_enable_nat_gateway"></a> [enable\_nat\_gateway](#input\_enable\_nat\_gateway)| Should be true if you want to provision NAT Gateways for each of your private networks |`bool`|`true`| no |
364
408
| <aname="input_firewall_dedicated_network_acl"></a> [firewall\_dedicated\_network\_acl](#input\_firewall\_dedicated\_network\_acl)| Whether to use dedicated network ACL (not default) and custom rules for firewall subnets |`bool`|`false`| no |
0 commit comments