This repository encompasses a collection of Terraform scripts crafted during my journey to achieve Terraform certification. Each script is designed to demonstrate specific Terraform functionalities and best practices, serving as both a learning tool and a reference for others pursuing similar goals.
The repository is structured into various directories, each focusing on different aspects of Terraform:
- AWS Infrastructure: Scripts for creating EC2 instances, S3 buckets, IAM roles, EKS clusters, and ELBs.
- State Management: Examples demonstrating remote state access and backend configurations.
- Advanced Features: Utilization of dynamic blocks, conditional expressions, and lifecycle meta-arguments.
- GitHub Integration: Automating repository creation and management using Terraform.
- Challenges: A series of self-imposed challenges to test and enhance Terraform proficiency.
Each directory contains:
main.tf: Primary Terraform configuration.variables.tf: Input variable definitions.outputs.tf: Output values after resource creation.README.md: Module-specific documentation.
For example, the aws-create-ec2 module includes scripts to provision an EC2 instance with customizable parameters.
Ensure the following are installed and configured:
- Terraform
- AWS CLI with appropriate credentials
- Git
-
Clone the repository:
git clone https://github.com/clowneon1/terraform.git cd terraform -
Navigate to the desired module directory:
cd aws-create-ec2 -
Initialize Terraform:
terraform init
-
Review and customize variables in
variables.tfor create aterraform.tfvarsfile. -
Plan and apply the configuration:
terraform plan terraform apply
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.