Skip to content

Terraform: convert login rule to generic provider - #69426

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

Terraform: convert login rule to generic provider#69426
rosstimothy wants to merge 1 commit into
masterfrom
tross/tf_login_rule

Conversation

@rosstimothy

Copy link
Copy Markdown
Contributor

Contributes to #69403.

Manual Test Plan

Test Environment

Local cluster with TF provider from this branch

Test Cases

  • Login 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 7, 2026 13:53

@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: bfc9e19a82

ℹ️ 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".

Codec: tfdriver.ResourceCodecFuncs[loginrulev1.LoginRule]{
SchemaFunc: schemav1.GenSchemaLoginRule,
ToStateFunc: schemav1.CopyLoginRuleToTerraform,
FromPlanFunc: schemav1.CopyLoginRuleFromTerraform,

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 clearing of obsolete login-rule traits

When an existing rule is changed from traits_expression to traits_map (or the reverse), the schema marks both attributes Optional+Computed, so Terraform's proposed plan preserves the omitted attribute from prior state. The generic resource now sends that plan straight through CopyLoginRuleFromTerraform, whereas the deleted resourceTeleportLoginRule.ModifyPlan replaced priority/traits_* with config-normalized values before update. In that switch-over scenario, a Terraform apply that is meant to replace an expression with a filtering map can leave the old expression active (or fail backend validation), so SSO trait and role mapping may not match the applied configuration.

Useful? React with 👍 / 👎.

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.

2 participants