Skip to content

πŸš€ This repo provides a foundational template for creating Terraform configurations that instantiate and manage infrastructure using reusable modules. 🎯

License

Notifications You must be signed in to change notification settings

Mosher-Labs/basic-terraform-infrastructure-template

Β 
Β 

Repository files navigation

basic-terraform-infrastructure-template

GitHub branch status GitHub Issues GitHub last commit GitHub repo size Libraries.io dependency status for GitHub repo GitHub License GitHub Sponsors

🌍 Basic Terraform Infrastructure Template πŸ› οΈ

Welcome to the Basic Terraform Infrastructure Template repository! πŸš€ This repo provides a foundational template for creating Terraform configurations that instantiate and manage infrastructure using reusable modules. 🎯

🌟 Key Features

  • πŸ“‚ Pre-organized structure for defining environments and instantiating Terraform modules.
  • πŸ› οΈ Includes examples for integrating modules, variables, and outputs.
  • πŸ”§ Follows Terraform best practices for scalability and maintainability.
  • 🌐 Compatible with various cloud providers and modular setups.

✨ Perfect for

  • Teams and individuals setting up new infrastructure projects quickly βš™οΈ
  • Learning Terraform through a practical, modular approach πŸ“š
  • Standardizing infrastructure deployments with reusable templates πŸš€

Start building your infrastructure with ease and confidence! 🀝

Usage

To use this repository template, simply fork the repo.

gh repo fork --fork-name <FORK_NAME> --org <ORG_NAME>

Update the repository settings:

gh repo edit --add-topic devops,reliability-engineering,axes \
--add-topic infrastructure-as-code,viking,mosher-labs \
--delete-branch-on-merge --enable-discussions=false \
--enable-issues=false --enable-merge-commit=false \
--enable-projects=false --enable-rebase-merge=false \
--enable-wiki=false --add-topic terraform

Create a ruleset for the default branch.

  • Ruleset Name: Default branch
  • Enforcement status: Active
  • Target Branches: Default
  • βœ… Restrict deletions
  • βœ… Require linear history
  • βœ… Require signed commits
  • βœ… Require a pull request before merging
  • βœ… Dismiss stale pull request approvals when new commits are pushed
  • βœ… Require conversation resolution before merging
  • βœ… Request pull request review from Copilot
  • Allowed merge methods: "Squash"
  • βœ… Require status checks to pass
  • βœ… Require branches to be up to date before merging
  • βœ… Do not require status checks on creation
  • Status checks that are required: pre-commit/pre-commit and terraform/terraform
  • βœ… Block force pushes
  • βœ… Require code scanning results

Enable Dependabot.

  • In Github UI, navigate to the repositories Settings > Code security
  • Enable Dependabot security updates
  • Enable Grouped security updates
  • Enable Dependabot version updates
  • Enable Dependabot on Actions runners
  • CodeQL analysis > Set up > Default
  • Enable Secret scanning
  • Enable Push protection

Update the templated information:

README.md

  • Replace basic-terraform-infrastructure-template with your <FORK_NAME>
  • Update the "Introduction" section
  • Update the "Usage" section
  • Update the "Contributing" section

πŸ”° Contributing

Upon first clone, install the pre-commit hooks.

pre-commit install

To run pre-commit hooks locally, without a git commit.

pre-commit run -a --all-files

To update pre-commit hooks, this ideally should be ran before a pull request is merged.

pre-commit autoupdate

πŸ“„ Documentation

Requirements

Name Version
terraform 1.10.4
null ~> 3
random ~> 3

Providers

Name Version
null 3.2.3
random 3.6.3

Modules

No modules.

Resources

Name Type
null_resource.this resource
random_string.random resource

Inputs

Name Description Type Default Required
config The config for creating this infrastructure. object({ name = string }) n/a yes

Outputs

Name Description
name The name created and used.

About

πŸš€ This repo provides a foundational template for creating Terraform configurations that instantiate and manage infrastructure using reusable modules. 🎯

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • HCL 90.6%
  • Ruby 9.4%