This document provides Linux-specific guidance for the Terraform workshop.
Follow the official installation guides for your distribution:
- Terraform: HashiCorp Installation Guide
- Google Cloud SDK: Google Cloud SDK Installation
- Git: Usually pre-installed, or use your package manager (e.g.,
sudo apt install git)
- Ubuntu/Debian: Use
apt- see Terraform APT and GCloud APT - CentOS/RHEL/Fedora: Use
yum/dnf- see Terraform YUM and GCloud YUM - Arch Linux: Use
pacmanor AUR - packages available in repositories
- Go to Google Cloud Console and log in with your Google account.
- Note the project ID you'll be using for the workshop.
In your terminal:
# Log in to Google Cloud
gcloud auth login
# Set the workshop project (if not prompted during login)
gcloud config set project cloud-labs-workshop-42clws
# Set up application default credentials for Terraform
gcloud auth application-default login
# Verify your setup
gcloud config listRun the setup verification script:
./verify-setup.shThis script will check that you have all required tools installed and properly configured.
Linux uses bash as the default shell on most distributions. The workshop commands are designed for bash and work out of the box.
Most Linux distributions include a terminal application. Common ones include GNOME Terminal (Ubuntu), Konsole (KDE), or your distribution's default.
Common Issues and Solutions:
-
"terraform: command not found": Ensure Terraform is in your PATH. Restart your terminal after installation.
-
"gcloud: command not found": Ensure Google Cloud SDK is in your PATH. You may need to restart your terminal or reinstall the SDK.
-
"gcloud auth list shows no accounts": Run
gcloud auth loginto authenticate. -
"Permission denied" when accessing project: Ensure you have the necessary IAM roles in the project. Contact workshop facilitators if using the provided project.
-
"Application Default Credentials not found": Run
gcloud auth application-default loginto set up credentials for Terraform. -
Terraform provider errors: Make sure you're in the
infra/directory and have runterraform init.
If commands aren't found after installation:
# Check your PATH
echo $PATH
# Restart your shell
exec -l $SHELLIf gcloud command is not found after installation:
# Restart your shell
exec -l $SHELL
# Or source the SDK if manually installed
source ~/google-cloud-sdk/path.bash.incFor more help, see the official troubleshooting guide.
Visual Studio Code is recommended for the workshop.
Installation: Follow the official VS Code Linux installation guide for your distribution.
Terraform extension:
# Install the Terraform extension
code --install-extension HashiCorp.terraformTerraform-specific plugins are available for: (Neo)Vim, IntelliJ IDEA and more.
# Navigation and files
cd directory # Change directory
ls -la # List files
vim filename.tf # Edit with vim
code filename.tf # Edit with VS Code
# System information
lsb_release -a # Distribution infoterraform --help
gcloud --help
man terraform # Manual pagesIf you encounter issues during the workshop, try the solutions above or ask workshop facilitators for help.