Skip to content

fix(enabled=false): remove resources#77

Open
dudymas wants to merge 1 commit intomainfrom
fix/enabled/remove-resources
Open

fix(enabled=false): remove resources#77
dudymas wants to merge 1 commit intomainfrom
fix/enabled/remove-resources

Conversation

@dudymas
Copy link

@dudymas dudymas commented Feb 5, 2026

what

  • migrate resources to be removed when enabled is set to false

why

  • expected behavior
  • while tofu supports lifecycle flags, this maintains broader support for those not on the latest tofu release

references

Summary by CodeRabbit

Release Notes

  • New Features

    • Added conditional enablement control for module components, allowing optional deployment based on configuration.
  • Refactor

    • Restructured resource dependencies for improved consistency and conditional resource management.
  • Chores

    • Implemented state migration support for existing deployments to ensure seamless upgrades.

@dudymas dudymas requested a review from a team as a code owner February 5, 2026 15:13
@dudymas dudymas requested a review from natemccurdy February 5, 2026 15:13
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This PR introduces conditional enablement across all Terraform resources by adding a local.enabled flag derived from the module's enabled status. Resources are gated with count = local.enabled ? 1 : 0 or conditional expressions, and resource references are updated to use the one() function to handle list-based access patterns. A new moved.tf file provides state migration rules to preserve existing infrastructure during the transition from singular to indexed resource declarations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Gowiem
  • oycyc
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enabling resources to be removed when the module's enabled flag is set to false, which aligns with the comprehensive scope of changes across multiple configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/enabled/remove-resources

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants