DEV Community

Rahul Wagh
Rahul Wagh

Posted on • Originally published at jhooq.com

1

How to create terraform modules? - Part 9

Terraform is an IaC(infrastructure as Code) framework for managing and provisioning the infrastructure but have you ever thought of creating only a single terraform configuration file for managing the complete cloud infrastructure.

Well, it sounds insane because if you only have a single file for managing the complete infrastructure then it will grow in complexity as well the line of configuration code will be manifold. That is why terraform introduced a concept of the module that will help you to organize your terraform configuration so that you can re-use the configuration and keep your terraform code more clean and more modular.

In this Lab session, we will create two modules module-1 and module-2. Inside each module, we will install the apache httpd server with each module is having its home page.

Steps for Creating the module -

  1. Create your first module
  2. Module structure
  3. Calling the module
  4. Module best practices
  5. Benefits of Modules

Terraform Module instruction guide? - https://jhooq.com/terraform-module/

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay