Skip to content

Add providers mirror subcommand#551

Merged
kmoe merged 3 commits intohashicorp:mainfrom
kmoe:providers-mirror-subcommand
Feb 3, 2026
Merged

Add providers mirror subcommand#551
kmoe merged 3 commits intohashicorp:mainfrom
kmoe:providers-mirror-subcommand

Conversation

@kmoe
Copy link
Member

@kmoe kmoe commented Nov 25, 2025

Closes #238

Add support for terraform providers mirror.

This subcommand, added in Terraform 0.13, downloads the providers required for the current configuration to a local directory, whose path is a required positional argument for the command.

The command has two optional flags: -platform=OS_ARCH and -lock-file=true, the latter of which was added in Terraform 1.10.

Testing

End-to-end tests and unit tests added.

@kmoe kmoe requested review from a team as code owners November 25, 2025 11:53
@kmoe kmoe force-pushed the providers-mirror-subcommand branch 3 times, most recently from a637a68 to 15c9ca7 Compare November 25, 2025 12:47
radeksimko
radeksimko previously approved these changes Nov 25, 2025
@SarahFrench
Copy link
Member

👋🏻 Can this be merged? I just merged a PR that will be released at some point in the near future (not urgent) and this feature could go out at the same time.

kmoe and others added 2 commits February 3, 2026 14:33
I believe the Latest_v1 constant was always meant to represent the latest available version with a major version of 1, but its use has been ambiguous. If we need a constant to represent the latest available version with a major version of 1 and minor version of 0, it should be named Latest_v1_0. Latest_v1 has been moved to the bottom of the declaration to make this clearer.
Add support for `terraform providers mirror`.

This subcommand, added in Terraform 0.13, downloads the providers required for the current configuration to a local directory, whose path is a required positional argument for the command.

The command has two optional flags: -platform=OS_ARCH and -lock-file=true, the latter of which was added in Terraform 1.10.

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
Co-authored-by: Daniel Schmidt <danielmschmidt92@gmail.com>
Co-authored-by: Matej Risek <matej.risek@hashicorp.com>
Co-authored-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@kmoe kmoe force-pushed the providers-mirror-subcommand branch from df62f14 to 2b44275 Compare February 3, 2026 14:33
@kmoe
Copy link
Member Author

kmoe commented Feb 3, 2026

I rebased and added a commit to update the changelog. @radeksimko please re-review. Will auto-merge when approved.

@kmoe kmoe enabled auto-merge (squash) February 3, 2026 14:36
@kmoe kmoe merged commit 9141118 into hashicorp:main Feb 3, 2026
107 checks passed
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.

Support terraform providers mirror

3 participants