I've noticed recently Terraform or AWS has made a change EC2 userdata so that changes don't trigger a 'replace' in terraform. Quote Terraform aws_instance docs: Updates to this field will trigger a stop/start of the EC2 instance.
We have automated deployments that rely on userdata changes to trigger replacements, so that the new userdata is ran everytime.
Is there a way Terraform can be told to replace instances is it notices new userdata? Lambda has a similar issue that is solved with 'source_code_hash' Is there something similar I can use here?
Thanks.