Day 16 - Managing AWS IAM Users with Terraform using CSV
Introduction Today I worked on managing AWS IAM users using Terraform with a CSV-driven approach. Instead of creating users manually in the AWS Console, I treated the CSV file as a source of truth. Terraform reads this file, creates users, assigns tags, and dynamically places them into groups. This felt very similar to database thinking. Each row in the CSV behaves like a table row, and Terraform applies logic on top of it. Architecture Overview What I Built IAM users created from CSV file IAM groups for logical organization Dynamic group membership using filters Tags used as metadata to drive logic Step 1: Using CSV as a Data Source The users.csv file acts as a structured dataset. Example: first_name,last_name,department,job_title Michael,Scott,Education,Regional Manager Dwight,Schrute,Sales,Assistant to the Regional Manager Each row represents one user. Step 2: Reading CSV in Terraform locals { users = csvdecode(file("${path.module}/users.csv")) } csvdecode() converts...