Skip to content

GeraldOpitz/gogs-tf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOGS-tf - Terraform Infrastructure as Code

Terraform configuration to provision the infrastructure required to deploy Gogs (Go Git Service) using Infrastructure as Code (IaC).


Project Overview

This repository contains Terraform code to provision the infrastructure required to run Gogs in a reproducible, automated, and scalable way.

Main goals of this project:

  • Apply Infrastructure as Code best practices
  • Separate environments (dev / prod)
  • Use reusable Terraform modules
  • Prepare the infrastructure for configuration with Ansible
  • Enable CI/CD integration (e.g. Jenkins)

Repository Structure

gogs-tf/
├── environments/
│   ├── dev/
│   └── prod/
├── modules/
│   ├── network/
│   ├── compute/
│   └── security/
├── .gitignore
└── README.md

Folder Description

environments/

Contains environment-specific Terraform configurations.

Each environment includes:

main.tf
variables.tf
outputs.tf
terraform.tfvars
backend.hcl

Examples:

  • dev: development environment
  • prod: production environment

modules/

Reusable Terraform modules that define infrastructure components such as:

  • Networking (VPC, subnets, routing)
  • Compute resources (EC2 instances)
  • Security (Security Groups, IAM roles)

Modules are called from the environments layer.

Example usage:

module "network" {
  source    = "../../modules/network"
  vpc_cidr = var.vpc_cidr
}

Pre-requisites

Before using this project, make sure you have:

  • Terraform
  • Git
  • Cloud provider credentials (e.g. AWS)
  • Environment variables or credential files properly configured

Usage

Clone the repository

git clone https://github.com/GeraldOpitz/gogs-tf.git
cd gogs-tf
git checkout GOGS-5-Terraform-Infrastructure-as-Code

Initialize Terraform

terraform init

Review the execution plan

terraform plan -var-file="environments/dev/terraform.tfvars"

Apply the infrastructure

terraform apply -var-file="environments/dev/terraform.tfvars"

Destroy the infrastructure (optional)

terraform destroy -var-file="environments/dev/terraform.tfvars"

Best Practices Implemented

  • Infrastructure as Code (IaC)
  • Environment separation (dev / prod)
  • Modular Terraform architecture
  • Ready for automation and CI/CD pipelines

Related Projects

This repository is part of a larger Gogs deployment stack:

  • Terraform: infrastructure provisioning
  • Ansible: configuration management
  • Gogs: self-hosted Git service
  • Jenkins: CI/CD automation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages