Update Terraform and vSphere-Provider

Terraform is a single .EXE-File so installation is about adding it’s folder to the $PATH-Variable and upgrading is about replacing „terraform.exe“ by the current version.

Update Terraform

C:\RH\LAB\TERRAFORM\vSphere_N9K>terraform --version
Terraform v0.15.2
on windows_amd64

Your version of Terraform is out of date! The latest version
is 1.0.11. You can update by downloading from https://www.terraform.io/downloads.html

C:\dir "c:\Program Files (exe)"\terraform*.*
 Volume in drive C is Windows
 Volume Serial Number is 583C-0C08

 Directory of c:\Program Files (exe)

05.05.2021  22:34        81.442.168 terraform.exe
               1 File(s)     81.442.168 bytes
               0 Dir(s)   8.344.129.536 bytes free

Download the current release („terraform_1.0.11_windows_amd64.zip“) unzip it and copy it to the correct destination:

C:\>dir "c:\Program Files (exe)"\terraform*.*
 Volume in drive C is Windows
 Volume Serial Number is 583C-0C08

 Directory of c:\Program Files (exe)

12.11.2021  17:41        60.838.776 terraform.exe
05.05.2021  22:34        81.442.168 terraform.bak

               2 File(s)    227.786.808 bytes
               0 Dir(s)   8.344.129.536 bytes free

C:\terraform --version
Terraform v1.0.11
on windows_amd64

Update vSphere-Provider

Using this „.tf“-File referencing the „hashicorp/vsphere“-Provider:

terraform {
  required_version = ">= 0.13"
  required_providers {
    vsphere = {
      source  = "hashicorp/vsphere"
    }
  }
}

and initialize the project with current provider(s):

C:\>terraform init -upgrade

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/vsphere...
- Installing hashicorp/vsphere v2.0.2...
- Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.


Schreibe einen Kommentar