feat: migrate zero_trust_access_group migrations #6013
Merged
+2,812
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements comprehensive v4→v5 migration support for zero trust access group resources,
handling both configuration syntax transformations and state schema upgrades for the breaking
changes in rule structure.
Okta)
Migration Scenarios Covered
email = ["[email protected]", "[email protected]"]
everyone = true, certificate = true
everyone = {}
,certificate = {}
objectsazure = [{ id = ["group1", "group2"] }]
azure_ad = { id = "group1" }
objectsgithub = [{ teams = ["team1", "team2"] }]
common_names = ["cert1", "cert2"]
common_name = { common_name = "cert1" }
Key Changes
Config Transformation (
cmd/migrate/zero_trust_access_group.go
)include
,exclude
, andrequire
rule blocks consistentlyState Upgrade Functions (
internal/services/zero_trust_access_group/migrations.go
)ResourceWithUpgradeState
interface for v0→v1 schema migrationMigration Tests (
internal/services/zero_trust_access_group/migrations_test.go
)statecheck
andknownvalue
assertionsCustom Test Helpers (
internal/acctest/zero_trust_access_group.go
)ExpectEmptyPlanExceptZeroTrustAccessGroupOrdering
- Custom plan checkerZeroTrustAccessGroupMigrationTestStep
- Specialized migration test helperSchema Definition (
internal/services/zero_trust_access_group/schema.go
)Test Results
All migration tests passing with proper validation of:
The migration maintains full backward compatibility while enabling the new v5 object-based rule
structure that provides better type safety and validation.
Changes being requested
Additional context & links