This Three Tier Web application sample TF code contains a VPC with 3 Subnets ( One public subnet for Web Tier, One Private Subnet for Application tier & One Private Subnet for Database tier).
Upon execution of Code - Infra is provisioned and a sample html page is deployed & outputs the Public IP.
Note: since this is Sample project, wrote code for single EC2 instance in Web tier. This can be modified according to the project requirements.