With the new terraform, repeative tasks are modulised. Making the code much cleaner.
See a list of terraform aws modules - https://registry.terraform.io/modules/terraform-aws-modules