---
title: "Enterprise Maturity Workshop: Terraform"
description: "This workshop teaches how to use Okta’s Terraform provider to manage users and groups in an Okta Organization while practicing beginner and intermediate Terraform skills. It explains desired-state configuration, where terraform plan predicts changes and terraform apply makes them, and describes how providers, resources, variables, data sources, and the terraform.tfstate file fit into a project. The exercises cover provider setup with a client ID and private key, secret handling, creating and assigning users and groups, importing resources, refactoring files, formatting code, and controlling API usage. It also uses errors and configuration drift to show how Terraform and Okta can disagree, then compares importing manual changes with applying Terraform’s declared state. The workshop concludes with cleanup through terraform destroy and points to further provider and Terraform documentation."
---

# Enterprise Maturity Workshop: Terraform

[Okta](https://yomu.fyi/company/okta) · E. Dunham · Jul 28, 2023

**Type:** Tutorial

## Summary

This workshop teaches how to use Okta’s Terraform provider to manage users and groups in an Okta Organization while practicing beginner and intermediate Terraform skills. It explains desired-state configuration, where terraform plan predicts changes and terraform apply makes them, and describes how providers, resources, variables, data sources, and the terraform.tfstate file fit into a project. The exercises cover provider setup with a client ID and private key, secret handling, creating and assigning users and groups, importing resources, refactoring files, formatting code, and controlling API usage. It also uses errors and configuration drift to show how Terraform and Okta can disagree, then compares importing manual changes with applying Terraform’s declared state. The workshop concludes with cleanup through terraform destroy and points to further provider and Terraform documentation.

## Context

The workshop is part of an enterprise-ready workshop series and assumes Terraform is installed and that participants have a free Okta Integrator Account. It focuses on managing identity as code in an Okta Organization and includes accompanying video demonstrations.

## Approach / What changed

Participants create a Terraform project, configure Okta’s provider with a client ID and private key, and use Terraform files to create, modify, import, and remove Okta users and groups. The workshop then introduces variables, environment variables, multi-line strings, file refactoring, formatting, configuration-drift handling, error resolution, and API-rate-limit controls.

## Takeaways

- terraform plan predicts the changes needed to match the desired state described in Terraform code, while terraform apply changes the infrastructure.
- Terraform state is stored in terraform.tfstate, and each piece of infrastructure should be represented in only one state file; collaborators can share state through Terraform Cloud or a similar service.
- When manual Okta changes create configuration drift, teams can either import those changes into Terraform or apply Terraform’s declared configuration, depending on which state is correct.

## FAQ

### How does Terraform respond when Okta changes are made manually?

Terraform detects differences during terraform plan and proposes changes to restore the configuration described in the Terraform files. The workshop compares importing the manual changes with applying Terraform’s declared state.

### How should credentials used by the Okta provider be handled?

The provider uses a client ID and private key, and anyone with those secrets can act on behalf of Terraform in the Okta organization. The workshop advises avoiding secrets in source control and using an appropriate secrets-management solution for automation.

### Can Terraform’s API usage be limited in an Okta organization?

Yes. The Terraform application in the Okta Admin Console has an Application Rate Limits tab with a slider for controlling how much of the organization’s total API rate limit Terraform consumes.

**Tags:** [Okta](https://yomu.fyi/topic/okta), [Terraform](https://yomu.fyi/topic/terraform)

- Source: [Okta](https://developer.okta.com/blog/2023/07/28/terraform-workshop)
- Source URL: https://developer.okta.com/blog/2023/07/28/terraform-workshop
- Ingested by Yomu: 2026-09-17T14:12:59.189Z

[Read original post](https://developer.okta.com/blog/2023/07/28/terraform-workshop)
