Modules Repository
In this section, we will guide you through the process of copying the required Terraform modules and setting up your environment. These modules will be the building blocks of your AWS infrastructure.
Step 1: Copy All Necessary Modules
To begin, you'll need to clone the repository that contains the Terraform modules you'll use to build your application infrastructure.
-
Clone the Repository:
Start by cloning the Terraform AWS Modules repository to your local machine. This repository contains various modules that can be used to create different AWS resources.git clone https://github.com/Selleo/terraform-aws-modules.git -
Copy All Modules:
Initially, it's recommended to copy all the modules to your project directory. This allows you to have all necessary resources readily available, simplifying the setup process.
Step 2: Recommended Terraform Structure
/terraform/: Root directory for all Terraform configurations./terraform/staging/: Directory for staging-specific resources./terraform/production/: Directory for production-specific resources./terraform/modules/: Directory for reusable modules shared across environments.
This structure promotes clear separation between environments and encourages reuse of common infrastructure components.
Copy all modules
It’s better to start with more modules and trim them down as your needs become clearer. Having extra modules initially won’t affect your infrastructure as long as they aren’t included in your Terraform configurations.
Step 3: Set Up Your Terraform Environment
Setting up your Terraform environment is crucial for managing your infrastructure efficiently. Follow our Terraform Cloud guide for detailed instructions on configuring your environment, including registration, organization setup, and account security.
Already using Terraform Cloud?
If you're familiar with Terraform Cloud, you can skip the initial setup and jump directly into configuring your infrastructure with the modules you copied.