-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
feat: introducing "copy_terraform_lock_file" to fine tune Lock File Handling #2889
Merged
yhakbar
merged 12 commits into
gruntwork-io:main
from
rodrigorfk:feature/copy-lock-file
Sep 24, 2024
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3ab235d
feat: introducing "copy_terraform_lock_file" to fine tune Lock File H…
rodrigorfk 2140d73
Merge branch 'refs/heads/master' into feature/copy-lock-file
rodrigorfk 508a4e1
Merge branch 'refs/heads/master' into feature/copy-lock-file
rodrigorfk 719d1a9
fix: renaming test name
rodrigorfk 4631be2
fix: linting doc files
rodrigorfk 0660404
Merge branch 'refs/heads/master' into feature/copy-lock-file
rodrigorfk 287275e
docs: applying suggestions
rodrigorfk af2ebe6
fix: adding comment about early return
rodrigorfk 73705a3
Merge branch 'refs/heads/main' into feature/copy-lock-file
rodrigorfk 7af49b9
fix: aligning code with the latest changes from main
rodrigorfk 3da7d40
test: fixing the TestRenderJsonMetadataTerraform test
rodrigorfk 199abe8
docs: applying suggestions
rodrigorfk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
8 changes: 8 additions & 0 deletions
8
test/fixture-download/local-disable-copy-terraform-lock-file/terragrunt.hcl
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,8 @@ | ||
inputs = { | ||
name = "World" | ||
} | ||
|
||
terraform { | ||
source = "../hello-world" | ||
copy_terraform_lock_file = false | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixture-download/local-include-disable-copy-lock-file/module-a/terragrunt.hcl
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,7 @@ | ||
inputs = { | ||
name = "Module A" | ||
} | ||
|
||
terraform { | ||
source = "../../hello-world" | ||
} |
14 changes: 14 additions & 0 deletions
14
test/fixture-download/local-include-disable-copy-lock-file/module-b/terragrunt.hcl
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,14 @@ | ||
inputs = { | ||
name = "Module B" | ||
} | ||
|
||
terraform { | ||
source = "../../hello-world" | ||
copy_terraform_lock_file = false | ||
} | ||
|
||
prevent_destroy = true | ||
|
||
include { | ||
path = find_in_parent_folders("terragrunt.hcl") | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixture-download/local-include-disable-copy-lock-file/terragrunt.hcl
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,7 @@ | ||
terraform { | ||
include_in_copy = ["**/.terraform-version"] | ||
} | ||
|
||
dependencies { | ||
paths = ["../module-a"] | ||
} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified as
return *terraformConfig.CopyTerraformLockFile
, with the last part of theif
statement removed above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the suggestion @yhakbar, but I am not sure if we should perform an early return like that, if we do that and the user explicitly defines
copyTerraformLockFile = true
on their terragrunt.hcl, terragrunt will copy the file on all commands, which will change the existing behaviour about copying it only for theinit
andproviders lock
command. Thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. It might help to leave a comment above the check to make sure that someone doesn't make the same logical mistake I'm making.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done @yhakbar, added the comment, do you mind having another look? thanks in advance