aws_launch_configuration has a dependedcy on iam_instance_profile. Since aws_launch_configuration has lifecycle{ create_before_destroy = true}, all its dependencies and their dependencies should have lifecycle{ create_before_destroy = true} this includes iam_instance_profile and its dependencies.
I would also like to thank you for the example it helped me a lot to get started, sharing is caring <3
(this also implies the chnage of some names to name prefixes)
https://github.com/arminc/terraform-ecs/blob/8a62442340ff4e58f1cbff61163c6c5d5d103779/modules/ecs_instances/main.tf#L36
aws_launch_configuration has a dependedcy on iam_instance_profile. Since aws_launch_configuration has lifecycle{ create_before_destroy = true}, all its dependencies and their dependencies should have lifecycle{ create_before_destroy = true} this includes iam_instance_profile and its dependencies. I would also like to thank you for the example it helped me a lot to get started, sharing is caring <3 (this also implies the chnage of some names to name prefixes)