Skip to content

etcollective/cloudflare

Repository files navigation


Cloudflare

Infrastructure-as-Code via Pulumi

Developed with the following:

Pulumi Python GitHub%20Actions

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

📒 Table of Contents


📍 Overview

The project defines global configuration for ETC's Cloudflare environment. CI/CD is provider via GitHub Actions.


🧩 Modules

Root
File Summary
main.py This code imports Python modules from subdirectories and executes all callable functions in each module. It assumes that each subdirectory contains Python modules (files with a '.py' extension) and skips the'init.py' file. The code iterates through the directories, imports the modules, and executes all callable functions found in each module.
Account
File Summary
members.py This code adds admin members with superadmin privileges to a Cloudflare account using the pulumi_cloudflare library. These admins are specified by their email addresses and assigned a specific role ID. The code ensures that each admin is associated with the account using parent resource options.
account.py This code sets up a Cloudflare account with specified configurations and exports the account ID for further use.
Dns_records
File Summary
mx_records.py This code creates MX records in Cloudflare for Google Workspace email using pulumi and the pulumi_cloudflare library.
gsuite_verification.py This code sets up DNS records for verifying Google Workspace and support accounts via Cloudflare DNS. It creates CNAME records with TTL of 3600 seconds.
website.py This code sets up DNS records for a staging website and a production website using the pulumi_cloudflare library. The staging website uses a CNAME record, while the production website uses A and AAAA records for both root and www subdomains. The records are proxied and have a TTL of 1.
atlassian.py This code creates DNS records in Cloudflare for domain verification and email authentication for an Atlassian service.
Domain
File Summary
zone.py This code sets up a Cloudflare zone for the specified domain with the specified account ID and plan.The zone is set to be not paused and to have a type of "full".The zone ID is then exported for future use.

🚀 Getting Started

✔️ Prerequisites

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

  • ℹ️ pulumi
  • ℹ️ Python
  • ℹ️ Dependencies defined in requirements.txt

📦 Installation

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

🎮 Using Pulumi

pulumi up