Last active
September 2, 2022 01:08
-
-
Save Bak-Jin-Hyeong/7558b7430a8ed5cb95e381f407e9c6d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env pwsh | |
# I always put a file named "backend.tf" in the root modules. | |
# Also, I don't create the name "backend.tf" in the non-root module directory. | |
# It seems to be my own rule, but most other people seem to do the same. | |
Get-ChildItem 'backend.tf' -Recurse | ` | |
Select-Object -ExpandProperty FullName | ` | |
ForEach-Object { ` | |
Write-Output $_; ` | |
terraform "-chdir=$(Split-Path $_)" init -upgrade; ` | |
terraform "-chdir=$(Split-Path $_)" providers lock ` | |
-platform=linux_amd64 ` | |
-platform=linux_arm64 ` | |
-platform=windows_amd64 ` | |
-platform=darwin_amd64 ` | |
-platform=darwin_arm64 ` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment