https://github.com/finkord/gogs-devops-intership
This repository contains the infrastructure-as-code (IaC) setup for deploying a full-featured Gogs (Go Git Service) instance in AWS using Terraform.
https://github.com/finkord/gogs-devops-intership
ansible aws docker docker-compose terraform vagrant
Last synced: 3 months ago
JSON representation
This repository contains the infrastructure-as-code (IaC) setup for deploying a full-featured Gogs (Go Git Service) instance in AWS using Terraform.
- Host: GitHub
- URL: https://github.com/finkord/gogs-devops-intership
- Owner: finkord
- Created: 2025-05-29T10:01:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-19T21:52:39.000Z (5 months ago)
- Last Synced: 2026-01-20T04:20:03.900Z (5 months ago)
- Topics: ansible, aws, docker, docker-compose, terraform, vagrant
- Language: HCL
- Homepage:
- Size: 6.16 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform Gogs Infrastructure Deployment
This repository provisions and manages cloud infrastructure to deploy the **Gogs** self-hosted Git service on **Amazon Web Services (AWS)**. It is developed as part of a DevOps internship project using **Terraform** for Infrastructure as Code and **GNU Make** for workflow automation.
The architecture is container-based, using **Amazon ECS with Fargate**, and integrates CI/CD pipelines and secure networking. The infrastructure is modular, reproducible, and suitable for production use.
## Prerequisites
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
- [GNU Make](https://www.gnu.org/software/make/)
- AWS CLI configured with valid credentials (`aws configure`)
## Directory Structure
```text
├── envs/ # Environment-specific configurations (e.g., dev/, global/)
├── modules/ # Reusable infrastructure modules (VPC, ECS, etc.)
├── Makefile # Task automation for all common actions
└── README.md
```
## Usage
All infrastructure actions are performed using `make` commands. The main variables are:
- `ENV` — Environment (default: `dev`)
- `SERVICE` — Service/component (e.g., `vpc`, `alb`, `rds`, etc.)
### Common Commands
1. **Initialize Terraform for a Service**
```sh
make init ENV=dev SERVICE=vpc
```
2. **Plan Infrastructure Changes**
```sh
make plan ENV=dev SERVICE=vpc
```
3. **Apply Changes**
```sh
make apply ENV=dev SERVICE=vpc
```
4. **Show Outputs**
```sh
make output ENV=dev SERVICE=vpc
```
5. **Destroy Infrastructure**
```sh
make destroy ENV=dev SERVICE=vpc
```
### Convenience Shortcuts
You can use shortcut targets for common services, e.g.:
```sh
make vpc-init
make vpc-plan
make vpc-apply
make vpc-destroy
```
See the [Makefile](Makefile) for all available shortcuts.
### Full Deployment Order
To deploy the full stack, run the following in order (adjust as needed for your environment):
1. **Global resources (e.g., ECR, S3):**
```sh
make ecr-apply
make s3-apply
```
2. **Networking and security:**
```sh
make vpc-apply
make sg-apply
```
3. **Core infrastructure:**
```sh
make rds-apply
make efs-apply
make alb-apply
make endpoints-apply
make route53-apply
```
4. **Application and supporting services:**
```sh
make ecs-apply
make iam-apply
make jenkins-apply
make ebs-apply
```
**Tip:** Always run `make plan` before `make apply` to review changes.
## Cleaning Up
To remove all resources for a service:
```sh
make destroy ENV=dev SERVICE=
```
Or use the shortcut:
```sh
make vpc-destroy
```
## Help
List all available commands:
```sh
make help
```
---
For more details, see the [Makefile](Makefile) and the `envs/` directory for service-specific configurations.