5. Copy all lab‐related Terraform files to your local system and add your keys - AndyGreenPhD/ksu_labs GitHub Wiki
You will need to use the most recent version of the Terraform scripts for your lab environment each time you start the lab. This process will explain how to download and unzip the most recent version of the lab's Terraform files to your local system.
All users will follow steps 1 and 2 regardless of operating system. Steps 3 and 4 are dictated based on your operating system.
- Using a web browser, visit the Github repo website located at https://github.com/AndyGreenPhD/ksu_labs
- Click on the green "Code" button and choose the "Download ZIP" option. Make note of what directory you download the zip file to, as you will need that detail in the upcoming steps.
Windows
Tutorial video can be viewed here
- Open the Command Prompt by typing "cmd" in the Windows search bar and clicking on the "Command Prompt" application.
- Type tar -zxvf LOCATION OF THE ZIP FILE -C "%HOMEPATH%" and press the Enter key. You must replace NAME OF THE ZIP FILE with the full path and the name of the zip file you downloaded, e.g. tar -zxvf ksu_labs-main.zip -C "%HOMEPATH%"
- Type notepad %HOMEPATH%\ksu_labs-main\3210_labs\main.tf to open your main.tf in Windows Notepad, a native text editor
- Copy your SSH public key that was generated earlier into the "public key" variable, save the file and close Notepad. NOTE: With Windows you will need to remove the domain\username piece, or you will receive an error during the build process later on.
- Type notepad %HOMEPATH%\ksu_labs-main\3210_labs\module\_init.tf to open your _init.tf file in the module folder
- Copy your AWS private and public access keys into the access key and secret key variables, save the file and close Notepad.
Mac
- Open a terminal and navigate to the directory where you downloaded the zip file to.
- Type unzip NAME OF THE ZIP FILE -d ~. You must replace NAME OF THE ZIP FILE with the actual name of the zip file you downloaded, e.g. unzip ksu_labs-main.zip -d ~
- Type cd ~/ksu_labs-main/3210_labs to move to the home directory for your Terraform scripts.
- Type open -a TextEdit main.tf to open the main.tf file and copy your SSH public key that was generated earlier into the "public key" variable, and save the file.
- Type open -a TextEdit module/_init.tf to open the _init.tf file in the module folder and update the access key and secret key values with your AWS access key and private key values