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

Remove -lock and -lock-timeout for terraform init #130

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

tonglil
Copy link
Contributor

@tonglil tonglil commented Jul 8, 2021

In order to use lock options in plan and apply, they have to be passed in init_options.
However, these options are used in terraform init.
But in 0.15, init no longer accepts these options.

Currently this blocks the use of lock options in 0.15 or higher.

Ideally these options are moved out of init into another parameter (like options).

https://www.terraform.io/upgrade-guides/0-15.html#other-minor-command-line-behavior-changes

The -lock and -lock-timeout options are no longer available for the terraform init command. Locking applies to operations that can potentially change remote objects, to help ensure that two concurrent Terraform processes don't try to run conflicting operations, but terraform init does not interact with any providers in order to possibly effect such changes.
These options didn't do anything in the terraform init command before, and so you can remove them from any automated calls with no change in behavior.

https://www.terraform.io/upgrade-guides/0-15.html#other-minor-command-line-behavior-changes

> The -lock and -lock-timeout options are no longer available for the terraform init command. Locking applies to operations that can potentially change remote objects, to help ensure that two concurrent Terraform processes don't try to run conflicting operations, but terraform init does not interact with any providers in order to possibly effect such changes.
> These options didn't do anything in the terraform init command before, and so you can remove them from any automated calls with no change in behavior.
@jmccann
Copy link
Owner

jmccann commented Jul 9, 2021

oic, we set lock stuff in init_options but use it also outside of init command (e.g. apply at https://github.com/jmccann/drone-terraform/blob/master/plugin.go#L268-L273). But this isn't actually supported by init anymore.

So first step here is to fix so that 0.15 works by no longer passing to init. But a followup would be to refactor lock and lock timeout config from init_options to options.

@jmccann jmccann merged commit 5e52bff into jmccann:master Jul 9, 2021
@jmccann
Copy link
Owner

jmccann commented Jul 9, 2021

released with tag 8.3-0.15.1

@tonglil
Copy link
Contributor Author

tonglil commented Jul 9, 2021

Exactly, thanks!

@tonglil tonglil deleted the patch-1 branch July 9, 2021 18:15
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.

2 participants