<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Okta Policy Creation Using the Terraform Provider

Okta Classic Engine
Okta Identity Engine
SDKs & Libraries

Overview

When creating multiple Okta policies through Terraform, new policies conflict with pre-existing policies if they share the same priority level. Managing all policies exclusively through Terraform, assigning unique priority values, and using the depends_on meta-argument to enforce creation order resolves this issue.

policies with the same priority

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Okta Terraform Provider

Cause

Pre-existing policies conflict with new policies created through Terraform when the new policies receive the same priority assignment as the existing policies.

Solution

How are policy priority conflicts resolved in Terraform?

Prevent overlap in policy or rule priorities by managing policy creation and modification exclusively in Terraform and defining unique priority values.

  1. Manage the creation and modification of policies and rules exclusively through Terraform.
  2. Define unique priority values for every policy or rule, starting with a priority of 1 and incrementing the priority by 1 for each subsequent policy or rule.
  3. Use the depends_on meta-argument to force Terraform to create and modify resources in the order of priority. Set the resource with a priority of 2 to depend on the resource with a priority of 1, the resource with a priority of 3 to rely on the resource with a priority of 2, and so on.

 

Related References

Loading
Okta Support - Okta Policy Creation Using the Terraform Provider