← Back to list

Day 2: Step-by-Step Guide to Setting Up Terraform, AWS CLI, and IAM Identity Center (SSO) on Ubuntu

I made it to day 2/30 of the Terraform challenge. Let me guide you on how to set up your environment on an Ubuntu Linux environment.

Sherry Obuhuma🍂 · 2026-03-20 12:07 · 0 claps · 1.6 min read
#hashicorp #aws #aws-sso #terraform #iac
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud 🔓 · Open Source

Day 2: Step-by-Step Guide to Setting Up Terraform, AWS CLI, and IAM Identity Center (SSO) on Ubuntu

I made it to day 2/30 of the Terraform challenge. Let me guide you on how to set up your environment on an Ubuntu Linux environment.

Credits to Brian Kepha for introducing me to IAM Identity Center which I opted to use instead of IAM user.

Install AWS CLI

In simple terms, the AWS Command Line Interface (AWS CLI) is a unified, open-source tool that allows users to manage and interact with AWS services using commands in their terminal or command prompt.

# Step 1: Download the installer using the command below:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

# Unzip & Install
sudo apt install unzip -y
unzip awscliv2.zip
sudo ./aws/install

# Verify
aws --version

Expected aws version output on the console

Expected aws version output on the console

Configure AWS CLI with IAM Identity Center (SSO)

Since I have SSO already configured on my machine, let us just dive straight in and login.

Some time later, I will write a detailed blog on how to configure IAM identity Center (SSO), be on the look out!

# Log in via SSO
aws login  //This command will automatically open your default browser & log you in

# Verify the connection
aws sts get-caller-identity  //Command should output UserId, Account, Arn

json

{
    "UserId": "XXXXXXXXXXXXXXXX:sherry",
    "Account": "XXXXXXXXXXXXXXXX",
    "Arn": "arn:aws:sts::39XXXXXXXX:assumed-role/AWSReservedSSO_AdministratorAcess_XXXXXXXXXXX""
}

Install Terraform on Ubuntu

# Install dependencies
sudo apt update && sudo apt install -y unzip wget

# Download Terraform
wget https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_linux_amd64.zip

# Unzip and install
unzip terraform_1.14.7_linux_amd64.zip

# Verify
terraform version

Expected Terraform version

Expected Terraform version

Key Takeaway

Terraform-up-and-running by Yevgeniy Brikman Chapter 2:Getting Started with Terraform

The root account should only be used once to set up your AWS environment. After that, all day-to-day activity should go through an IAM user or IAM Identity Center (SSO) with administrator access. This protects your root account from accidental misuse or security exposure and follows AWS best practices.


메타데이터
post_id
b1ddb52840f4
slug
day-2-step-by-step-guide-to-setting-up-terraform-aws-cli-and-iam-identity-center-sso-on-ubuntu-b1ddb52840f4
url
https://medium.com/@SherryObuhuma/day-2-step-by-step-guide-to-setting-up-terraform-aws-cli-and-iam-identity-center-sso-on-ubuntu-b1ddb52840f4
canonical_url
https://medium.com/@SherryObuhuma/day-2-step-by-step-guide-to-setting-up-terraform-aws-cli-and-iam-identity-center-sso-on-ubuntu-b1ddb52840f4
author_url
https://medium.com/@SherryObuhuma
status
ok
fetched_at
2026-06-28 04:42:08