Skip to content

rimselis/terraform-beginner-bootcamp-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Beginner Bootcamp 2023

Semantic versioning

This project utilizes semantic versioning for its tagging - MAJOR.MINOR.PATCH.

Commit message should include issue number.

Progress

Check OS version

Run cat /etc/os-release

Create bash script for terraform installation in gitpod

init script in .gitpod.yml downloads and installs Terraform. Initial template had an issue that stopped the installation process to ask for user input. New installation processes is created in bash install script by copying steps mentioned in Terraform documentation for Ubuntu.

Initially script file can be run using source command (e.g., source ./bin/install-terraform-cli.sh) or just by running ./bin/install-terraform-cli.sh. For the latter to work though, a change mode (chmod) command has to be ran on the script.

To check the current change mode, a ls -la command can be used. It will show three groups of letters rwx (e.g., drwxr-xr-x, -rw-r--r--) where r stands for read, w - write, and x - execute. Three groups are - User, Group and Others.

To change the file chmod to allow execution, run chmod u+x ./bin/install-terraform-cli.sh. It can be changed using numbers as well (e.g., chmod 744 ./bin/install-terraform-cli.sh) which relys on numerical permissions.

Note: Template uses init task in .gitpod.yml, but it is run only with new non-prebuilt workspaces, so init can be changed to before to always run them when environment/workspace is started.

Environment variables

Checking & searching existing environment variables

env

env | grep terraform-beginner-bootcamp-2023

Setting a variable in terminal scope

export PROJECT_ROOT='SOME_VALUE'
echo $PROJECT_ROOT

Setting a variable globally

To set env variable globally, bash profiles can be used or using GitPod.

Using GitPod

gp env PROJECT_ROOT='/workspace/terraform-beginner-bootcamp-2023'

After restart, it should be available in the terminal.

AWS CLI

Checking AWS credentials

aws sts get-caller-identity