Terraform: Creating A Custom Module For EC2

Troy Ingram
6 min readJun 14, 2021

Use Case

A simple Terraform file has been made by team member in your organization to launch an EC2 instance. Your company would like to use this template as the standard for launching EC2 instances, however it does not currently follow Terraform best practices. You have been directed to modify the file so that it is a module, allowing easy re-use by team members within the company.

--

--

Troy Ingram

Cloud DevOps Engineer | 5x AWS Certified | Terraform Associate | Python | Linux | DevOps