What are the challenges of using Terraform for user management?

July 15, 2025 4 answers
Asked by TechWiz42
I've been using Terraform for a while, and I'm considering applying it to manage user onboarding and offboarding. I envision Terraform creating users in Active Directory (AD), adding them to our GitHub organization, and assigning licenses for tools like Adobe Suite, M365, and others that might need some custom Terraform providers. When someone leaves, I'd want Terraform to handle disabling users and freeing up licenses. However, I seldom see discussions about Terraform used this way. Has anyone tried this approach for user management? What pitfalls or challenges have you encountered?

Answers

CloudNinja99
Using Terraform for user management sounds interesting, but the suggestion to utilize SSO might be more streamlined. Typically, managing users can be simplified by placing them into groups, which handles permissions and access without the overhead.
Reply to this answer
SysAdminGuy22
Honestly, Terraform isn't really set up for user management tasks. Youโ€™d likely be better off with scripts in PowerShell or Bash to handle user tasks effectively.
Reply to this answer
AutomateAllTheThings
I've actually implemented something similar! If you're using Terraform with a CI/CD system like Atlantis, onboarding can be as simple as the new user submitting their first PR to add themselves to various resources. SSO is definitely part of the solution, but it's important to remember itโ€™s mainly for sign-on, not permissions provisioning. Think about how onboarding works at your companyโ€”will Terraform fit into that process?

FutureReadyDev: Youโ€™re right! SSO often has features for automatic provisioning. Adding users to groups in AD can trigger profile creation in GitHub when they first log in. When you disable a user in AD, they can't access other services, which is a key advantage of using SSO alongside Terraform.

TerraformEnthusiast: I agree! Terraform can manage the user creation part, but SSO is essential for a smooth experience. I think combining both methods is the way to go!

Reply to this answer
DevOpsDude84
In my opinion, trying to use Terraform this way might be a bit of a stretch. Terraform is primarily designed for managing cloud resources, not user processes. Instead, consider using Ansible or Python for automation, which can be more effective for these kinds of tasks. Plus, integrating a good SSO solution can centralize your user management much better.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions