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

Avoid terraform init for import workspaces when --dev-provider is specified #350

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Feb 3, 2023

For environment that has dev_overrides correctly setup for the providers, users can use --dev-provider to indicate instead of using the pinned version, use the local dev provider. Another effect of using dev_overrides is that it will not check the dependency lock for each terraform command, hence avoid calculating the provider hash everytime. This saves us a bit of CPU time, especially we are running terraform commands in parallel.

Therefore, this PR extends the --dev-provider a bit to not only remove the version constraint in the terraform.tf, it will also avoid the terraform init for the import directories, as the follow up terraform command will not use that file at all (given dev_overrides). This saves us some CPU time during Init().

… specified

For environment that has `dev_overrides` correctly setup for the providers, users can use `--dev-provider` to indicate instead of using the pinned version, use the local dev provider. Another effect of using `dev_overrides` is that it will not check the dependency lock for each terraform command, hence avoid calculating the provider hash everytime. This saves us a bit of CPU time, especially we are running `terraform` commands in parallel.

Therefore, this PR extends the `--dev-provider` a bit to not only remove the version constraint in the `terraform.tf`, it will also avoid the `terraform init` for the import directories, as the follow up terraform command will not use that file at all (given `dev_overrides`). This saves us some CPU time during `Init()`.
@magodo magodo added the enhancement New feature or request label Feb 3, 2023
@magodo magodo merged commit 082e05f into Azure:main Feb 3, 2023
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

Successfully merging this pull request may close these issues.

1 participant