Skip to content
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

Add support for other providers sub-commands #201

Closed
philnielsen opened this issue Jul 14, 2021 · 5 comments
Closed

Add support for other providers sub-commands #201

philnielsen opened this issue Jul 14, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@philnielsen
Copy link
Contributor

philnielsen commented Jul 14, 2021

Right now the only providers command supported is providers schema, there are several more provider commands available now and support for them would be greatly appreciated.

I would consider adding myself if you all are open to contributions for such a feature.

@radeksimko radeksimko added the enhancement New feature or request label Jul 14, 2021
@radeksimko radeksimko changed the title Add Support for Complete support for Terraform providers command Add support for other providers sub-commands Jul 14, 2021
@radeksimko
Copy link
Member

Hi @philnielsen
In general we are open to contributions.

When it comes to adding support for new (sub)commands I'd usually ask first whether there's a real use case you have in mind (or know of) for these in the context of automation?

While most commands make sense in automation, some commands are meant to be used by humans - e.g. terraform console, terraform login and terraform logout (at least in the current state).

There are some commands which are border-line at first sight but we decided to include them because real use cases came up - e.g. 0.12upgrade or 0.13upgrade.

Do you have some ideas on how you'd use providers lock or providers mirror in any program of yours?

@philnielsen
Copy link
Contributor Author

philnielsen commented Jul 14, 2021

Thanks for taking a look @radeksimko

Specifically my use case is we currently automatically bootstrap new terraform states for teams without having to know anything about our s3 backend setup. providers lock is the useful add here, because we want to be able to generate a .terraform.lock.hcl file for teams after instantiating a generic terraform setup with the AWS provider configured.

As of TF14, now teams (who are mostly using darwin systems for development) have to remember to manually run terraform providers lock -platform=linux_amd64 -platform=darwin_amd64 otherwise our CI system (which is linux container based) won't work when they run for the first time. i'm hoping to add provider lock command to the boostrap cli (closed source for now) to pre-fetch these checksums as part of the bootstrap so there is one less command to run manually.

@radeksimko
Copy link
Member

Thank you for describing that use case - that sounds reasonable. Feel free to send a PR for providers lock.

Do you have a use case in mind for the mirror subcommand also?

Either way I'd suggest keeping the PRs narrowly focused - 1 command per PR is ideal.

@philnielsen
Copy link
Contributor Author

I don't currently have a use case for mirror, but i'll hop in and work on that PR for lock when I get a chance!

philnielsen added a commit to philnielsen/terraform-exec that referenced this issue Jul 28, 2021
Adds feature requested in hashicorp#201. This allows programatic generation of
`.terraform.lock.hcl` files via this library
radeksimko pushed a commit that referenced this issue Aug 4, 2021
* Add `providers lock` Command

Adds feature requested in #201. This allows programatic generation of
`.terraform.lock.hcl` files via this library

* Add Min Version Check To `providers lock`

This command was added in 0.14 so it should helpfully error out if used
with a version before that. Also cleaned up some godoc comments per PR
feedback.
@radeksimko
Copy link
Member

lock command was added in #203 and because there isn't any known use case for mirror within automation I'm going to close this issue but feel free to open a new one if you find a use case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants