Skip to content

Conversation

@bryantbiggs
Copy link
Member

@bryantbiggs bryantbiggs commented Aug 1, 2025

Description

  • Refactor modules to group single resource modules into higher order modules
  • Terraform v1.5.7 is now minimum supported version
  • AWS provider v6.3 is now minimum supported version
  • Replace zones and records module with new zone module that creates a Route53 zone, records, as well as association authorization, and DNSSEC signing key
  • Remove delegation-sets module; users are encouraged to use the standalone resource for this functionality
  • Remove resolver-rule-associations; this functionality can be implemented with the standalone resource or used within whats provided in the resolver-endpoint module
  • Remove zone-cross-account-vpc-association; this functionality is split up with the association authorization resource added within the new zone module, and the association resource should be implemented on its own by users
  • A new resolver-firewall-rule-group is added from the experimental proposal here
  • Add support for Terragrunt wrappers which follow the norms of our other modules

Motivation and Context

Breaking Changes

  • Yes; there are no attempts at trying to migrate resources from v5.0 and prior into this new module structure. Users are free to continue using the prior versions as is, forking at a prior version and utilizing their fork if they require changes, or removing the resources in question from Terraform state and performing imports into the new module structure

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 have executed pre-commit run -a on my pull request

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good, just a few comments here and there.

@@ -1,5 +0,0 @@
resource "aws_route53_delegation_set" "this" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi from Terragrunt users :) Let's keep these single-resource modules, please.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-added in 3c4c32c

locals {
# Terragrunt users have to provide `records_jsonencoded` as jsonencode()'d string.
# See details: https://github.com/gruntwork-io/terragrunt/issues/1211
records = concat(var.records, try(jsondecode(var.records_jsonencoded), []))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to get rid of this pure magic, but Terragrunt users will have to find their way to migrate to the newer (simpler) version of this module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, I don't know how to tackle that one. perhaps folks will help collaborate on this upgrade path; I've never used Terragrunt

# Zone
################################################################################

resource "aws_route53_zone" "this" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While here, in this PR, can you add support for using the existing zone conditionally without creating it?

I think it is a rather common case that a zone has been created separately, and users want to manage just the records or other properties using this module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, makes sense - added in 923cce5

@@ -0,0 +1,270 @@
# AWS Route53 Zone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: What if we have this module moved to the root instead of having it under modules/zone? I think this is rather logical because this module does a lot more than just a zone.

WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense - done in e4f5551

@bryantbiggs
Copy link
Member Author

cc @antonbabenko if you have time/feedback on the proposed changes

@antonbabenko
Copy link
Member

cc @antonbabenko if you have time/feedback on the proposed changes

I certainly should look into these... I was (and still am) rather busy with other things, but I will do it this week.

@bryantbiggs
Copy link
Member Author

no worries and no rush - a few other fires I'm dealing with at the moment anyways 😓

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me. Sorry that it took ages for me to review!

@bryantbiggs bryantbiggs merged commit 0417d5b into terraform-aws-modules:master Sep 20, 2025
9 checks passed
@bryantbiggs bryantbiggs deleted the feat/upgrade branch September 20, 2025 13:11
antonbabenko pushed a commit that referenced this pull request Sep 20, 2025
## [6.0.0](v5.0.0...v6.0.0) (2025-09-20)

### ⚠ BREAKING CHANGES

* Refactor modules to group single resource modules into higher order modules (#122)

### Features

* Refactor modules to group single resource modules into higher order modules ([#122](#122)) ([0417d5b](0417d5b))
@antonbabenko
Copy link
Member

This PR is included in version 6.0.0 🎉

@nikolay
Copy link

nikolay commented Sep 22, 2025

@bryantbiggs Is your goal to really make us stop using these modules?! The time we spend refactoring is not worth the time initially saved by these modules! I sincerely regret getting lured into these modules!

@bryantbiggs
Copy link
Member Author

What a dumb question. Nobody is forcing you to upgrade to the next major version of the module. However, upgrades are a normal part of software development lifecycle as we try to both reduce the maintenance burden and add support for the latest features of both the AWS provider, the underlying resources themselves, as well as the Terraform language itself

@bryantbiggs
Copy link
Member Author

Take a look at the number of issues/PRs this change alone resolved. Do better as a human

@nikolay
Copy link

nikolay commented Sep 23, 2025

@bryantbiggs "Dumb question," says the person who didn't bother to write upgrade/migration docs, made really dumb mistakes in the past with these "upgrades", and who gives this type of "highly professional" attitude. I was sponsoring @antonbabenko, and he was doing an amazing job, unlike you, but I'm done with it since you hijacked this project and started to "improve" it! I'm fairly certain you don't use these modules at work, given that you work for Amazon. Maybe if you used them daily, you would know what I'm talking about.

@antonbabenko
Copy link
Member

@nikolay I appreciate that you've been using these modules for a long time. The changes we are implementing are, as Bryant says, optional to adopt (upgrade is always fully optional), but required for us to support better practices overall.

This specific module is quite old and had numerous hacks related to Terragrunt and older versions of Terraform, so improvements were inevitable.

Probably, the only thing we could have implemented differently in this release is related to the upgrade instructions, which could have minimized the amount of resource recreation. The rest is pretty solid in my mind.

@petegallagher
Copy link

@bryantbiggs and @antonbabenko thank you so much for all the time and effort you have poured into these modules. It is unfortunate that many people in the community do not appreciate these efforts sufficiently. Keep fighting the good fight!

@Sharsie
Copy link

Sharsie commented Sep 23, 2025

I appreciate the effort, at the same time I understand where @nikolay is coming from. The recent changes made to some of these AWS modules introduced many breaking changes and/or bugs without any possible workarounds.

It's not necessary to be rude though. It is a huge effort to maintain and develop the modules. And noone is entitled to it. If you don't like it, don't use it.

With that said, I would appreciate if there was a bigger focus on testing and documentation. Having to go through the code to figure out how to migrate between such a huge breaking change takes a lot of effort (and frustration) as well. E.g. how do I specify an APEX/ROOT dns record? Using full_name with zone name and name with empty string. This was handled automatically in v5.0.0 so it's counter intuitive to go searching how to provide such options in v6.0.0. Was there a reason this wasn't provided? In other instances, I would call this a regression.

It's just an example, but I believe having a v5.0.0 example and trying to do a migration to v6.0.0 to see some of these issues arise would benefit the community.

Aproaching it with "We could not be bothered to provide a migration path and if you don't like it, don't upgrade" is backwards thinking in my opinion. Obviously people will want to (and eventually need to) upgrade and this is just delegating time from one person to many. It is my belief that maintaining such repositories comes with a responsibility to the community as well.

Again, I see both sides and I appreciate the effort that is being put into developing the modules. In the end, it is yours to maintain and do as you wish. Just sayin'

@bryantbiggs
Copy link
Member Author

Thank you for the thoughtful post - migrations between major versions of a module that include breaking changes are one of the hardest things in Terraform. Both for maintainers and consumers. Unfortunately the Terraform state migration utilities are quite basic today and do not support the majority of the use cases required (namely - migrating from count to for_each and resource consolidation). But I want to hone in on one point:

Aproaching it with "We could not be bothered to provide a migration path and if you don't like it, don't upgrade" is backwards thinking in my opinion. Obviously people will want to (and eventually need to) upgrade and this is just delegating time from one person to many. It is my belief that maintaining such repositories comes with a responsibility to the community as well.

Ignoring the part that these modules are provided for free and are widely used to generate billions of dollars (yes, billions - I know this for a fact); how would you approach situations where a migration path is not possible? Meaning, there is no clear path from a v1.x to a v2.0 (again, where you start is a whole separate topic - the assumption is that users migrate from the greatest minor/path version of the most recent major version prior to the new major version).

If we don't make changes, we continue to have users adopt a module with know deficiencies and a long, difficult path to reach the latest features of the service(s), provider, and Terraform language. This is akin to continuing to grow and add to the user technical debt. It also forces users who want/need to adopt the latest for whatever reason, to fork or seek alternative solutions.

If we do make changes, those who want/need to get to the latest have a path that must be navigated (unfortunately). Which path they choose, is up to them, and we do strive to provide guidance for navigating at least one path (i.e. - a migration guide of guidance). Those who do not need the latest, who are content with the current functionality of the module are able to simply stay on the version of their choosing.

So given the two paths, the latter seems more beneficial given the pros/cons as well as in terms of the options afforded users. But again, there are no guarantees that there is a "clean" path to get from A to B (clean meaning - without disruption, destructive changes, etc.). So in those scenarios, what do you propose should be done?

@bryantbiggs
Copy link
Member Author

Missed the whole point of one statement above - adding here to avoid edits (that muddies the water and feels dishonest on the interwebs)

Ignoring the part that these modules are provided for free and are widely used to generate billions of dollars (yes, billions - I know this for a fact)

  • of which Anton and myself, as well as any other maintainers past and present, have not seen any material benefits in terms of shared revenue for the value provided

@Sharsie
Copy link

Sharsie commented Sep 23, 2025

I do not disagree (aehm) with any motivation or views that you shared (well maybe except for one)

Unfortunately the Terraform state migration utilities are quite basic today and do not support the majority of the use cases required (namely - migrating from count to for_each and resource consolidation).

Well that depends. I am not saying there has to be some automated way to migrate. But instructions can be provided that describe the steps a user needs to take... e.g. modules/zones removal could use the following instructions (pseudocode)

how would you approach situations where a migration path is not possible? Meaning, there is no clear path from a v1.x to a v2.0

Lets make one thing clear, when you refer to migration, do you mean state migration or migrating between module versions? When I'm referring to migration, I mean instructions on how to get from vN -> vN+1. Yes, there may be cases where you stop supporting some parts of the module and those resources get removed - which are ideally deprecated in advance (and not removed straight off the bat). Only in such cases, I would argue it's ok to say "resource XYZ is no longer supported by this module". Ideally, give options to use other modules or raw TF. The user would always have an option of copy pasting code from prior version of the module into their source code - this can also be offered as an option with provided snippets using moved blocks.

Other than that, I would argue all other migrations can be documented, even if it means creating separate TF state, using terraform state rm and terraform import there is always a way to do that. As long as you can import existing infrastructure into terraform, there (probably?) is a way.

Additionally, I would never expect anyone to provide migration paths between more than 1 major version, even though some projects do it. But to me, migration path means you can get from 1 -> 1+N in N steps, not in 1 step.

If we don't make changes, we continue to have users adopt a module with know deficiencies and a long

That's an argument you may be making for others, but I absolutely do agree that stuff needs to move, even if it's breaking. I do not oppose that in any way.

Those who do not need the latest, who are content with the current functionality of the module are able to simply stay on the version of their choosing.

I do disagree with this statement completely. Yes, people can stay for a while, but eventually, you are forced to upgrade. Provider API may change and a pinned module version will eventually produce warnings and then break. Unless you expect to support v5.0.0 going forward and upgrade that branch to work with the latest provider (I don't see why would you), this statement in my opinion does not hold.

Even if it would be possible to use multiple provider versions in a single terraform root module to support this as a legacy module, underlying API (aws) may also change and it's just not true that people can stay if they chose to.


these modules are provided for free

and all other related comments

I absolutely do understand what you are providing for the community and I really do appreciate that. Unforunately human nature does not. It is honestly extremely difficult explaining to my colleagues over and over that not every change can be easily tested in all possible variations and all possible environments. And that maintainers don't break their code on purpose.

Unfortunately what is happening is:

1. I am using this great module
2. This guy broke it again
3. I'm mad
4. I channel my frustration without care

- Humans

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.