fixed-host-ignore-user-data
Fixed host ignores user_data edits, so a live box is no longer stopped and started (agent manager 8a3d302, option A; unblocks the flagship status-alarm rollout from 3dd38c04).
Change: aws_instance.host lifecycle ignore_changes = [ami] becomes [ami, user_data], with a comment saying why. userdata runs only at first boot, and userdatareplaceonchange is already false, so an in-place userdata update on a live box only buys a stop/start (downtime) and changes nothing the box does. A new box still boots with the current script; rebuilding a live box from it is an explicit -replace.
Why now: carloku-infrastructure #32/#33 (f1c41c9, 2639a27) added a 21-line relay drop-in to the flagship host-init after the boxes launched. Every targeted plan that touches aws_instance.host (the status alarms depend on it) therefore planned a user_data update, meaning a stop/start, on all four flagship boxes.
That relay drop-in drift stays unapplied on the four live flagship boxes. That is already true today; this change only stops tofu from trying to apply it through a stop/start. If those boxes need the drop-in, it has to be installed on the running boxes by hand or by a script.
Evidence: a read-only flagship plan (-lock=false) against this branch's module, targeting the 8 alarms plus the moved IE/UK/AU instance/EIP/SG addresses, gives 4 add / 4 change / 0 destroy; the moves have zero attribute lines and no instance update. Without this change the same plan was 4 add / 8 change, with user_data updates on all four instances.
Tests: tests/userdataignored.tftest.hcl. It applies against the mock and then plans with an edited script: no userdata change is planned, and an instancetype change still plans. The test fails with the old lifecycle. 23/23 locally across the parseable files. Census proposal included (main.tf body change; one new test file).
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- paul@keymail.dev pushed 07ff2077f region-host: fixed host ignores user_data edits (no stop/start)