mr_C
Re:Terraform 0.15 General Availability
on Thursday April 15, 2021 @04:41AM (#26817772)
Not true, just set state to absent and run your play again.
Re:Terraform 0.15 General Availability
on Thursday April 15, 2021 @04:37AM (#26817720)
I came up with trivial examples because no one forgets about non-trivial resources. In my opinion, if you decrease some instance count from 18 to 3, you'd rather waste 1 minute deleting 15 instances than dealing with all the problems a state management brings to the table.
Re:Terraform 0.15 General Availability
on Thursday April 15, 2021 @04:25AM (#26817622)
Using ec2_instance_info to check if the instance exists filtering by name (eg: selectattr('tags.Name', 'defined') | selectattr('tags.Name', 'equalto', server_name) ) and then standard ec2_instance module, same for lb.
Re:Terraform 0.15 General Availability
on Wednesday April 14, 2021 @05:23PM (#26813293)
Who cares if there is a dangling dns records somewhere or an extra allocated floating ip? In practice you could just set state:absent to whatever you are trying to remove or just remove it manually, the latter is most of the time faster than dealing with state management once you have a behemoth in prod that no one wants to break.
Re:Terraform 0.15 General Availability
on Wednesday April 14, 2021 @04:48PM (#26812857)
Maybe an unpopular opinion but what you just described as "naive" is arguably a better solution than Terraform's overengineering.
I use Ansible to manage multiple clouds (Openstack, AWS...etc) using a mix of custom modules and public collections. I don't need a "state", I couldn't care less if resources exist or not, upgrades between versions are smooth, module/collection upgrades doesn't interfere with all the existing resources we already have... every time I run a playbook I know that everything will end up just like I want it to be. Not bad for a naive approach I guess.