Commit ca79086
committed
Fix managed mode to properly delete out-of-band ACL rules
When managed=true, the provider now correctly detects and deletes ACL rules
that were created outside of Terraform (out-of-band rules).
Implementation:
- Read function adds 'dummy' rules to state for out-of-band rules when managed=true
- These dummy rules contain the UUID of the out-of-band rule
- On next apply, Terraform detects the diff (dummy rule in state, not in config)
- Update function deletes the dummy rules, which deletes the actual out-of-band rules
This approach is consistent with the legacy resource_cloudstack_network_acl_rule.go
and ensures that managed ACLs stay in sync with the configuration.
Tests:
- Added TestAccCloudStackNetworkACLRuleset_managed to verify out-of-band deletion
- Verified TestAccCloudStackNetworkACLRuleset_not_managed still works correctly1 parent 5a25310 commit ca79086
File tree
2 files changed
+77
-10
lines changed- cloudstack
2 files changed
+77
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
457 | | - | |
| 456 | + | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
463 | 484 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | 485 | | |
468 | 486 | | |
469 | 487 | | |
| |||
Lines changed: 52 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
146 | 168 | | |
147 | 169 | | |
148 | 170 | | |
| |||
500 | 522 | | |
501 | 523 | | |
502 | 524 | | |
| 525 | + | |
| 526 | + | |
503 | 527 | | |
504 | 528 | | |
505 | 529 | | |
| |||
513 | 537 | | |
514 | 538 | | |
515 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
516 | 568 | | |
517 | 569 | | |
518 | 570 | | |
519 | 571 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | 572 | | |
524 | 573 | | |
525 | 574 | | |
| |||
0 commit comments