-
Notifications
You must be signed in to change notification settings - Fork 63
feature: Add support for multiple backup plans #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: lgallard <[email protected]>
@copilot I wonder if it's backward compatible, or if we can considere using It would be great having migrated by default in code, if possible |
Co-authored-by: lgallard <[email protected]>
I've implemented terraform moved blocks for automatic migration from single plan to multiple plans structure! The solution includes: Automatic Migration (7fab3c6):
Migration Guide:
Full Backward Compatibility:
For users migrating, they just need to:
The implementation follows the terraform moved pattern you suggested! Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot it seems we have a edge case. I tried to run a plan and got this error:
|
@copilot it seems we have a edge case. I tried to run a plan and got this error:
p.s: I reposted this comment in text format, it seems you had some issues accessing the attached image of the previous comment |
Co-authored-by: lgallard <[email protected]>
... I've fixed the terraform moved blocks issue in commit 345ae10. The problem was that the moved blocks were conflicting with our backward compatibility approach - they tried to move resources that still existed in the configuration. Since we maintain backward compatibility through conditional resource creation rather than actual resource migration, the moved blocks were inappropriate and have been removed. Users can still migrate using the manual state management approach documented in the migration guide (examples/migration_guide/README.md). Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot It seems there are some issues when using null for same variables and dynamic blocks:
|
…n_tags Co-authored-by: lgallard <[email protected]>
... I've fixed the null value handling issues in the dynamic blocks. The problem was that optional fields The fix uses
This ensures that null values are properly handled and converted to empty objects/arrays as needed. The fix has been applied to both the legacy selections and the new multi-plan selections for consistency. Fixed in commit f172b67. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot please fix the issue: Plan: 12 to add, 0 to change, 0 to destroy. |
Co-authored-by: lgallard <[email protected]>
... Fixed the null value handling issue in dynamic condition blocks. The problem was that while we were using Fixed in commit 53db56e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I tested locally taking the simple_plan
example and migrating it to the new plans map approach.
Overview
This PR adds support for creating multiple backup plans within a single module instance. Previously, the module only supported one plan per vault, but now users can define multiple plans with their own sets of rules, schedules, and resource selections.
Implementation
The implementation allows defining multiple backup plans using a new
plans
variable while maintaining full backward compatibility with the existing single plan approach. Key changes include:plans
variable as a map of maps, where each key represents a plan and its value contains rules and selectionsmain.tf
to support both the legacy single plan and the new multi-plan approachselection.tf
to associate selections with their respective plansexamples/multiple_plans
showing how to create daily, weekly, and monthly backup plansREADME.md
to explain the new featureExample Usage
Fixes #114.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.