helix-collective / hx-terraform

0 stars 4 forks source link

dont ignore user_data by default #123

Closed jcalderin closed 2 years ago

jcalderin commented 2 years ago

By default, if the user_data is changed do not ignore the change

timbod7 commented 2 years ago

In practice it has not turned out well when I've tried this in the past.

When user data changes are ignored, you can always force them to be applied by tainting the instance so that it gets recreated.

But if userdata is not ignored, it's not possible to avoid recreating an instance, even for trivial change to the userdata script.

jcalderin commented 2 years ago

They change the behaviour in V4+, now user_data doesn't trigger a replacement unless you give a new flag (https://github.com/hashicorp/terraform-provider-aws/pull/23604).

When the number of instances is small I agree with you, but when it starts to grow is unpractica, we start to have different scripts depending on when the instance was last launched so the code doesn't match the instance anymore. As an example, I did this change because i need to change/re-create 39 instances :(

I just want to get rid of instances alltogether :)