-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terraform: install modules when updating lockfile
Terraform requires modules to be installed with `terraform init` when updating the lockfile. Opted to only run `terraform init` if the call to `terraform providers lock` bails out and retry. We could opt to always run `terraform init` if there are any modules defined but would mean parsing the dependency files and checking if any of the dependencies are modules as we only have access to the current dependency, which in this case is provider.
- Loading branch information
Showing
5 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
terraform/spec/fixtures/projects/lockfile_with_modules/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
terraform/spec/fixtures/projects/lockfile_with_modules/caf_module.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module "caf" { | ||
source = "aztfmod/caf/azurerm" | ||
version = "5.1.0" | ||
} |
9 changes: 9 additions & 0 deletions
9
terraform/spec/fixtures/projects/lockfile_with_modules/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
github = { | ||
source = "integrations/github" | ||
version = "~> 4.4" | ||
} | ||
} | ||
required_version = ">= 0.14" | ||
} |