Skip to content

feat: Issue 1193 support for tagging subnets by name #1217

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

Conversation

voidshard
Copy link

@voidshard voidshard commented Jun 30, 2025

Description

Allows one to add per-subnet tags, settable by subnet name.

Motivation and Context

Currently it is possible to set tags on all subnets, or all subnets of a given distinction (eg. public, private, ..) but it is not possible to set tags on a given subnet. This is the motivation behind this issue and the related MR. This MR adds the same support for each subnet type rather than just public & private.

Breaking Changes

None

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects

I added my own simple example. It includes cases where all, none and a subset of subnets have custom tags added by name.

@voidshard voidshard changed the title 1193/support for tagging subnets by name feat/issue 1193 support for tagging subnets by name Jun 30, 2025
@voidshard voidshard force-pushed the 1193/Support_for_tagging_subnets_by_name branch from 5da956a to 55a871b Compare June 30, 2025 15:32
@voidshard voidshard force-pushed the 1193/Support_for_tagging_subnets_by_name branch from 55a871b to 9bd4853 Compare June 30, 2025 15:35
@voidshard voidshard changed the title feat/issue 1193 support for tagging subnets by name feat: issue 1193 support for tagging subnets by name Jun 30, 2025
@voidshard voidshard changed the title feat: issue 1193 support for tagging subnets by name feat: Issue 1193 support for tagging subnets by name Jun 30, 2025
@voidshard voidshard force-pushed the 1193/Support_for_tagging_subnets_by_name branch from 152d025 to 9ae1a79 Compare June 30, 2025 15:45
@voidshard
Copy link
Author

@antonbabenko @bryantbiggs please let me know your thoughts - we switched to using this module at work to define our VPCs but need a bit more flexibility to tag subnets appropriately for autodiscovery & configuration purposes.

@jpriebe
Copy link

jpriebe commented Jul 30, 2025

This is a big problem for us. We tried to use aws_ec2_tag on the subnets outside of the module to add the kubernetes.io/role/internal-elb tags to the specific private subnets we want to use for internal load balancers, but then our terraform plans have perpetual noise as the terraform-aws-modules/vpc/aws module wants to delete the tags, and then on the next run, the aws_ec2_tag resource wants to restore the tags.

Is there at least a workaround for this problem (other than ignoring tags with the "kubernetes.io/role" prefix?

@voidshard
Copy link
Author

@antonbabenko @bryantbiggs please can we have a review?

@bryantbiggs
Copy link
Member

yes - unfortunately we are not going to accept this approach as we've stated several times before in other PRs

@voidshard
Copy link
Author

voidshard commented Aug 1, 2025

yes - unfortunately we are not going to accept this approach as we've stated several times before in other PRs

That's fine, but in that case can we have an explanation & some kind of work around? Or what approach would you accept? I'm happy to work on something because like everyone who made those other PRs - I have the same problem. Work with us dude.

Right now we either run terraform & tag subnets by hand, or use aws-ec2-tag and have the two resources fight it out on each run.

@jpriebe
Copy link

jpriebe commented Aug 8, 2025

I can't believe how resistant the maintainers have been to this concept. Not even just the implementations -- it seems like the very concept is anathema to them.

We have multiple sets of private subnets. Only one set should be tagged with EKS tags. But if we tag via terraform outsidde of this module, the module wants to remove them on the next apply, and then on the next apply after that, our terraform wants to restore them. I'm stuck with infinite noise and potential breakage of EKS.

Please provide a viable workaround, or at least tell us this feature is on your short-term roadmap.

@bryantbiggs
Copy link
Member

I can't believe how resistant the maintainers have been to this concept. Not even just the implementations -- it seems like the very concept is anathema to them.

We have multiple sets of private subnets. Only one set should be tagged with EKS tags. But if we tag via terraform outsidde of this module, the module wants to remove them on the next apply, and then on the next apply after that, our terraform wants to restore them. I'm stuck with infinite noise and potential breakage of EKS.

Please provide a viable workaround, or at least tell us this feature is on your short-term roadmap.

Please provide funding, or at least have patience as we work through a number of significant changes

@voidshard
Copy link
Author

voidshard commented Aug 11, 2025

If you want to ask for funding you first have to clearly communicate your plans and intentions -- no one provides funding into an unknown black box. Well, no one that isn't a government.

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.

3 participants