Skip to content

Terraform: convert db object import rule to generic provider - #69421

Open
rosstimothy wants to merge 1 commit into
masterfrom
tross/tf_db_import_rule
Open

Terraform: convert db object import rule to generic provider#69421
rosstimothy wants to merge 1 commit into
masterfrom
tross/tf_db_import_rule

Conversation

@rosstimothy

Copy link
Copy Markdown
Contributor

Contributes to #69301.

Manual Test Plan

Test Environment

Local cluster with TF provider from this branch

Test Cases

  • DB Oject Import Rule lifecycle via TF operates as expected without drift

@rosstimothy rosstimothy added the no-changelog Indicates that a PR does not require a changelog entry label Aug 6, 2026
@rosstimothy
rosstimothy marked this pull request as ready for review August 6, 2026 14:51
@github-actions
github-actions Bot requested a review from tigrato August 6, 2026 14:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +47 to +48
func NewDatabaseObjectImportRuleResourceType() tfdriver.ResourceType[dbobjectimportrulev1.DatabaseObjectImportRule, tfdriver.NameIdentifier] {
return tfdriver.ResourceType[dbobjectimportrulev1.DatabaseObjectImportRule, tfdriver.NameIdentifier]{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 hugoShaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much cleaner :)

@public-teleport-github-review-bot
public-teleport-github-review-bot Bot removed the request for review from tigrato August 7, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants