From 258241a82548404bf4aba36ebc655e71b6a99544 Mon Sep 17 00:00:00 2001 From: Larry <34108925+gamethis@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:32:29 -0500 Subject: [PATCH] Fix boot (#36) * updating terraform install * updating startup * fix boot * updated tfdocs install --- .devcontainer/code_space.sh | 26 +++++++++++------------ .gitignore | 1 + exercise1/providers.tf | 2 +- exercise6/modules/helloworld/providers.tf | 2 +- exercise6/providers.tf | 2 +- modules/module1/providers.tf | 2 +- modules/module2/providers.tf | 2 +- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.devcontainer/code_space.sh b/.devcontainer/code_space.sh index f6b8117..6f34ac3 100755 --- a/.devcontainer/code_space.sh +++ b/.devcontainer/code_space.sh @@ -40,18 +40,23 @@ function getLatestRepoVersion() { echo "Install Terraform Docs" -TFDOCS_VERSION: 0.18.0 +TFDOCS_VERSION=0.18.0 sudo go install github.com/terraform-docs/terraform-docs@v${TFDOCS_VERSION} echo "Done Installing Terraform Docs" echo "=========================" echo "Install Terraform" -VERSION=$(getLatestVersion) -cd ~ -wget "https://releases.hashicorp.com/terraform/"$VERSION"/terraform_"$VERSION"_linux_amd64.zip" -unzip -o "terraform_"$VERSION"_linux_amd64.zip" -sudo install terraform /usr/local/bin/ - +sudo apt-get update && sudo apt-get install -y gnupg software-properties-common +wget -O- https://apt.releases.hashicorp.com/gpg | \ +gpg --dearmor | \ +sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null +echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ +https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \ +sudo tee /etc/apt/sources.list.d/hashicorp.list + +sudo apt-get update -y +sudo apt-get install terraform -y +terraform --version echo "Done Installing Terraform" echo "=========================" @@ -83,8 +88,6 @@ trivy server --download-db-only echo "Done install trivy" echo "=========================" - - echo "run pre-commit" pre-commit run --all-files echo "Done running pre-commit" @@ -139,10 +142,7 @@ pip3 install hvac echo "============" echo "Install tfupdate" -$REPO="minamijoyo/tfupdate" -$LATEST=getLatestRepoVersion "${REPO}" -wget https://github.com/${REPO}/releases/${LATEST}/download/tfupdate_${LATEST}_linux_amd64.tar.gz -sudo tar -xvlsf tfupdate_${LATEST}_linux_amd64.tar.gz -C /usr/local/bin tfupdate +sudo go install github.com/minamijoyo/tfupdate@latest tfupdate --version echo "Done installing tfupdate" echo "============" diff --git a/.gitignore b/.gitignore index 0f03d89..2a1550d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ exercise2/Dockerfile */act Bonkey-Container-Update.yaml HelloWorld.txt +tflint_linux_amd64.zip diff --git a/exercise1/providers.tf b/exercise1/providers.tf index 92ba790..7744322 100644 --- a/exercise1/providers.tf +++ b/exercise1/providers.tf @@ -5,5 +5,5 @@ terraform { version = "2.5.1" } } - required_version = "1.9.2" + required_version = "1.9.4" } diff --git a/exercise6/modules/helloworld/providers.tf b/exercise6/modules/helloworld/providers.tf index 92ba790..7744322 100644 --- a/exercise6/modules/helloworld/providers.tf +++ b/exercise6/modules/helloworld/providers.tf @@ -5,5 +5,5 @@ terraform { version = "2.5.1" } } - required_version = "1.9.2" + required_version = "1.9.4" } diff --git a/exercise6/providers.tf b/exercise6/providers.tf index 92ba790..7744322 100644 --- a/exercise6/providers.tf +++ b/exercise6/providers.tf @@ -5,5 +5,5 @@ terraform { version = "2.5.1" } } - required_version = "1.9.2" + required_version = "1.9.4" } diff --git a/modules/module1/providers.tf b/modules/module1/providers.tf index 92ba790..7744322 100644 --- a/modules/module1/providers.tf +++ b/modules/module1/providers.tf @@ -5,5 +5,5 @@ terraform { version = "2.5.1" } } - required_version = "1.9.2" + required_version = "1.9.4" } diff --git a/modules/module2/providers.tf b/modules/module2/providers.tf index 92ba790..7744322 100644 --- a/modules/module2/providers.tf +++ b/modules/module2/providers.tf @@ -5,5 +5,5 @@ terraform { version = "2.5.1" } } - required_version = "1.9.2" + required_version = "1.9.4" }