Project Restructure: Service Level Packages #20431
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
proposal
Proposes new design or functionality.
provider
Pertains to the provider itself, rather than any interaction with AWS.
Milestone
Community Note
Closely related #20000
Description
The structure of the Terraform AWS provider codebase is not scaling well as it grows. This explosive growth is fuelled by the AWS provider’s popularity and AWS’s ever increasing services. As a result, maintainers and community contributors face an unnecessary layer of difficulty maintaining the code base such as non-responsive IDEs and the inability to see all project files on GitHub.
In order to better follow Go best practices and address these growing pains, we are planning significant code refactoring of the Terraform AWS Provider. The refactoring will position the provider for better maintainability now and into the future as AWS ever expands its offerings.
Code for every AWS service we support, in 2,000+ Go files, lives in one massive package. A single line change requires the entire package to be recompiled, which at best, can take several minutes. Contributors, maintainers, IDEs, Go compilers, and security scanning products, have unnecessary overhead dealing with such a massive package. At the same time, many tasks require jumping back and forth between different directory structures.
Proposal
The primary goal is simply stated: move everything related to a single AWS service, such as
ec2
, into one package. This includes resources, data sources, associated tests, and support code. During the refactor, we will also undertake housekeeping to simplify things like naming and imports. Further details are given below.This solution provides several benefits:
Cutover Process
This refactoring will occur as a "big-bang" change, internally these changes will be automated and tested against our acceptance test suite before rollout. The consequence of this is that most if not all existing Pull Requests will become unmergeable "as-is" due to the large amount of structural changes.
The date of the rollout will be communicated publicly, and guides on how to update your Pull Request will also be made available closer to the confirmed date.
We realize that many Pull Requests have been sitting for some time without being addressed. We want to make it very clear that the mergability of a Pull Request due to structural changes like this do not affect its prioritization for review. Once a Pull Request is prioritized for review, the maintainers will either make those changes directly or work with the PR author to do so. There is no expectation from the maintainers that the community updates their PR's en-masse, but we realize that some authors will choose to do so in order to explore the new package structure. We will make these requirements explicit both in the contributing guide, our linter suite and from this issue.
The text was updated successfully, but these errors were encountered: