I use the module, https://github.com/terraform-aws-modules/terraform-aws-ec2-instance to provision the ec2 instances on AWS. I would like to have AWS auto scaling group feature implemented, i.e. in case one of the ec2 instances is not healthy, AWS auto replaces it. But, I do not see the code, resource "aws_autoscaling_group" inside the above ec2 instance module. Question:
Yes, it is not only reasonable, but actually considered a best practice to use an auto scaling group for EC2 instances.
you can do so using the terraform autoscaling module: https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws/latest