Migrate from okta-business-roles¶
okta-business-roles is no longer tracked in this repo (as of 3.7.0) and is deleted in the next major version. Until then, the versions already published (up to 3.6.0) stay in HCP Terraform, so existing workspaces keep resolving them, but the module gets no further releases and does not publish to Pulumi Cloud. Move to the two Forge modules that replaced it before the next major version.
This guide is for you if a workspace calls app.terraform.io/SAIFCorp/saif-business-roles/okta (or the older alias business-roles/okta). To find your workspaces, open HCP Terraform's Explorer, choose Modules, and filter the source on saif-business-roles/okta. In Azure DevOps, search code for saif-business-roles/okta ext:tf.
Forge's migration runbook covers the full repo-level steps (YAML rewrites, pipeline templates, cleanup PRs). This page adds the module-level details and corrects two version constraints in the runbook (see Gotchas).
Replacement modules¶
The old module did both jobs in one call. Each Forge module now does one:
You pass to okta-business-roles |
Use instead | Creates |
|---|---|---|
BusinessRolesExternal |
app.terraform.io/SAIFCorp/business-roles-external/saif |
Okta groups and group rules for external users |
BusinessRolesCorp |
app.terraform.io/SAIFCorp/business-roles-corp/saif |
Entra ID security groups for corp users |
Both come from saif-corp/forge (src/terraform/saif-business-roles-external and saif-business-roles-corp). The saif- prefix is the Forge folder name, not part of the registry address. Use the HCP Terraform address above; Forge owns where these modules are published.
Pin them as ~> 3.9.0. The latest stable release is 3.9.3 (checked 2026-10-07), and every stable release so far is 3.6.0 or later.
What changes¶
This is a state-preserving swap, but it is not only a source and version change.
| Old | New | |
|---|---|---|
| Calls | One call with both inputs | One call per module |
| External inputs | TeamName, BusinessRolesExternal with Name, Description, Roles, CompoundRoles, ManualUsers |
team_name, business_roles with name, description, roles, compound_roles, manual_users |
| Corp inputs | BusinessRolesCorp with Name, Description, RoleSets (Division, Roles), ManualUsers |
business_roles with name, description, role_sets (division, job_titles), manual_users |
is_production |
Optional, defaults to false |
Required on the corp module |
| Outputs | None | external_groups, corp_groups |
| External state | module.OktaBusinessRolesExternal, module.groupRulesRolesExternal, module.groupRulesManualUsersExternal |
Moved by moved blocks inside the module, so you add nothing |
| Corp state | module.entra_id["<role>"].module.group.* |
module.entra_id_group["<role>"].*, with no moved blocks in the module, so you add them |
The Entra group resources themselves do not change. The security/azure group module source is identical between 3.2.5 (what the old module's ~> 3.2.0 resolves to) and 4.7.0 (what the new corp module uses).
Before and after¶
Keep the same module label (busRoles below) so the existing state addresses line up with the moved blocks.
External¶
# Before
module "busRoles" {
source = "app.terraform.io/SAIFCorp/saif-business-roles/okta"
version = "~> 3.4.0"
TeamName = "Customer"
BusinessRolesExternal = {
"Injured Worker" = {
Name = "Injured Worker"
Description = "Workers who have filed injury claims"
Roles = ["InjuredWorkerAccess"]
CompoundRoles = []
ManualUsers = []
}
}
}
# After
module "busRoles" {
source = "app.terraform.io/SAIFCorp/business-roles-external/saif"
version = "~> 3.9.0"
team_name = "Customer"
business_roles = {
"Injured Worker" = {
name = "Injured Worker"
description = "Workers who have filed injury claims"
roles = ["InjuredWorkerAccess"]
compound_roles = []
manual_users = []
}
}
}
Corp¶
# Before
module "busRoles" {
source = "app.terraform.io/SAIFCorp/saif-business-roles/okta"
version = "~> 3.4.0"
is_production = var.is_production
BusinessRolesCorp = {
"Claims Adjuster" = {
Name = "Claims Adjuster"
Description = "Claims staff"
RoleSets = [{ Division = "Claims Division", Roles = ["Claims Adjuster I"] }]
ManualUsers = []
}
}
}
# After
module "busRoles" {
source = "app.terraform.io/SAIFCorp/business-roles-corp/saif"
version = "~> 3.9.0"
is_production = var.is_production
business_roles = {
"Claims Adjuster" = {
name = "Claims Adjuster"
description = "Claims staff"
role_sets = [{ division = "Claims Division", job_titles = ["Claims Adjuster I"] }]
manual_users = []
}
}
}
# One pair per role, keyed by the role's map key. Remove after the first apply.
moved {
from = module.busRoles.module.entra_id["Claims Adjuster"].module.group.azuread_group.group[0]
to = module.busRoles.module.entra_id_group["Claims Adjuster"].azuread_group.group[0]
}
moved {
from = module.busRoles.module.entra_id["Claims Adjuster"].module.group.azuread_group_without_members.group_without_members[0]
to = module.busRoles.module.entra_id_group["Claims Adjuster"].azuread_group_without_members.group_without_members[0]
}
Production workspaces hold the azuread_group resource and non-production workspaces hold azuread_group_without_members. Terraform ignores the pair that does not exist in state.
Check the plan¶
Run a speculative (read-only) plan from a branch or pull request, with terraform init -upgrade first so the provider constraints refresh. The plan has to show:
0 to add, 0 to change, 0 to destroy.- Each group and rule listed as
has moved toits new address.
Stop and investigate on any destroy or create. For corp, the usual cause is a moved block key that does not match the role key in state (terraform state list | grep entra_id shows the keys). For external, the usual cause is a changed role name or a different module label, because the module keys its groups by name.
An in-place update of dynamic_membership_rule on a corp group is the one known exception, and only when a division or job title contains a single backslash. See Gotchas.
Roll back¶
- Before the apply: close the pull request.
- After the apply: the state addresses have changed, so reverting only the configuration plans a destroy and create. Restore the workspace's state version from before the apply (the workspace's States tab keeps them), then revert the configuration.
Confirm the workspace has a recent state version before you apply.
Gotchas¶
- Forge's runbook pins do not resolve. It shows
>= 1.0.0, < 2.0.0for external and>= 4.0.0, < 5.0.0for corp. The published releases of both modules are 3.6.0 to 3.9.3, so those ranges match nothing andterraform initfails. Use~> 3.9.0. - Provider constraints differ. The external module needs
okta/okta >= 4.18.0(the old module needed>= 4.10.0). Raise the constraint in your workspace and runinit -upgrade. The corp module needs onlyhashicorp/azuread >= 3.0, < 4.0, so it no longer needs the Okta provider. - Corp map keys have to stay the same. The
movedblocks use them. The generated files key the map by role name:{ for role in local.yaml_roles.business_roles : role.name => role }. - Corp backslash escaping. The old module doubled a single backslash in a division or job title before it built the dynamic membership rule, and the new module leaves it alone. Two backslashes, quotes and plain text behave the same. Search your role YAML for backslashes before you plan.
team_namemust not be empty. The oldTeamNamedefaulted to""; the external module rejects an empty or blank value.- One call that passed both
BusinessRolesCorpandBusinessRolesExternalneeds two module calls, one per module, and state moves for both. Talk to the Platform team first. - Older versions. This guide compares 3.6.0 of
okta-business-roles; 3.3.0 to 3.5.0 have the same files. Older versions (1.x) were not compared, so read a workspace's plan closely if it is still on one. - The old registry entries stay until the next major version. Workspaces that have not migrated keep resolving them until then.
Drafted by GitHub Copilot