Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

cdiaz2799/digitalocean-infrastructure

Repository files navigation


digitalocean-infrastructure

Pulumi Infrastructure as Code

Developed with the software and tools listed below.

Pulumi Python

GitHub top language GitHub code size in bytes GitHub commit activity GitHub license

📒 Table of Contents


📍 Overview

The project is focused on quickly setting up infrastructure on the DigitalOcean cloud platform. It provides a collection of code modules that enable the creation of various resources such as projects, virtual machines (droplets), databases, DNS records, and VPCs. The code automates the deployment and configuration process.


⚙️ Features

Feature Description
⚙️ Architecture The codebase follows a modular architecture, where components are organized into separate folders. It utilizes Pulumi for infrastructure provisioning.
🔗 Dependencies The code relies on external libraries like Pulumi, DigitalOcean API, and Cloudflare API for resource management and infrastructure tasks.
🔌 Integrations The system heavily interacts with external services like DigitalOcean and Cloudflare through their respective APIs. There are no evident communication patterns with third-party systems apart from these integrations.

📂 Project Structure


🧩 Modules

Root
File Summary
main.py This code iterates over folders in a given directory, imports Python modules within these folders, and executes callable functions within these modules. It allows for dynamic execution of code in a structured manner.
component_project.py This code defines an "AppProject" class that creates a new DigitalOcean project. The project is given a name, description, and environment. The class also registers the project's URN as an output.
Actual
File Summary
actual.py This code sets up a DigitalOcean project, creates a web application, and sets up DNS records using Pulumi.
Paperless
File Summary
droplet.py The code sets up a Droplet (virtual machine) on DigitalOcean for the Paperless project. It defines the Droplet's specifications, including the region, size, image, and SSH key. The Droplet is also associated with a VPC and has monitoring and an agent enabled.
project.py The code imports a project component and creates an AppProject object for a paperless app with specified app name and project name.
Outline
File Summary
db.py This code configures a DigitalOcean database and firewall rules for an Outline application. It defines a database, a user, and firewall rules that allow connections from a specific Droplet.
droplet.py This code sets up a DigitalOcean VM (Virtual Machine) for the Outline app, assigns a reserved IP address, and adds the VM to a project for resource management.
dns.py This code sets up a DNS record for an Outline server using the Cloudflare DNS provider. It retrieves the Zone ID for "cdiaz.cloud", creates a DNS record named "outline" with the A record type, and points it to the Outline server's IP address. The DNS record is set to be proxied by Cloudflare. The code then exports the hostname of the DNS record.
project.py This code sets up a project called "Outline" on the DigitalOcean cloud platform. It includes the project's name, description, environment, and purpose.
Master
File Summary
vpc.py This Python Pulumi code deploys VPC(s) on DigitalOcean in the specified regions. It uses the Pulumi DigitalOcean provider to create VPC resources, setting the VPC name and region for each VPC. The created VPC(s) are stored in the vpcs list.
ansible.py This code provisions a DigitalOcean virtual machine (Droplet) running Ubuntu, with specified tags and SSH key. It also associates the Droplet with a VPC and deploys cloud-init configuration. Finally, it adds the Droplet to a project for organization and management.
database.py The code creates a database cluster on the DigitalOcean platform using different engines such as Postgres, MySQL, MongoDB, and Redis. It sets the engine version, cluster name, node count, region, size, and connects it to a private network.
project.py This code creates a DigitalOcean project called "master" for operational and developer tooling with protection enabled.
opconnect.py This code deploys a DigitalOcean Droplet running Rocky Linux and sets up a firewall with inbound and outbound rules. It also creates a DNS record with Cloudflare.

🚀 Getting Started

✔️ Prerequisites

Before you begin, ensure that you have the following prerequisites installed:

  • ℹ️ Pulumi
  • ℹ️ DigitalOcean
  • ℹ️ Cloudflare

📦 Installation

  1. Clone the digitalocean-infrastructure repository:
git clone https://github.com/cdiaz2799/digitalocean-infrastructure.git
  1. Change to the project directory:
cd digitalocean-infrastructure
  1. Install the dependencies:
pip install -r requirements.txt

🎮 Using digitalocean-infrastructure

pulumi up

🧪 Running Tests

pulumi preview

👏 Acknowledgments

  • ℹ️ readmeai - AI Readme Generation

About

Pulumi IaC for DigitalOcean resources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages