Terraform: convert db object import rule to generic provider - #69421
Terraform: convert db object import rule to generic provider#69421rosstimothy wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79a4caf711
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| func NewDatabaseObjectImportRuleResourceType() tfdriver.ResourceType[dbobjectimportrulev1.DatabaseObjectImportRule, tfdriver.NameIdentifier] { | ||
| return tfdriver.ResourceType[dbobjectimportrulev1.DatabaseObjectImportRule, tfdriver.NameIdentifier]{ |
There was a problem hiding this comment.
Restore plan normalization for import rules
When updating an existing rule by omitting a previously-set optional/computed nested field such as spec.mappings[*].match.table_names, this generic resource no longer has the generated ModifyPlan hook that rebuilt spec from config before apply. Because the generated schema marks these nested fields Optional+Computed with UseStateForUnknown, Terraform will keep the old state value in the plan and FromPlanFunc sends that stale matcher back to Teleport, so an admin cannot remove old match criteria and database objects can continue to be imported/labeled after they were intended to be excluded.
AGENTS.md reference: AGENTS.md:L8-L16
Useful? React with 👍 / 👎.
hugoShaka
left a comment
There was a problem hiding this comment.
That's much cleaner :)
Contributes to #69301.
Manual Test Plan
Test Environment
Local cluster with TF provider from this branch
Test Cases