Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

🚀 Automating Subdomains & Databases with AWS Route 53, FastAPI, and NGINX

Managing multi-tenant SaaS apps can get tricky. Each tenant usually needs: A unique subdomain A dedicated database A scalable backend to handle requests Manually setting up subdomains and databases is painful. So… I automated it. 😎 …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Managing multi-tenant SaaS apps can get tricky.


Each tenant usually needs:




  • A unique subdomain

  • A dedicated database

  • A scalable backend to handle requests



Manually setting up subdomains and databases is painful. So… I automated it. 😎



In this guide, I’ll walk you through how I built an automatic subdomain + database provisioning system using:





  • AWS Route 53 → Manages subdomains


  • FastAPI → Handles tenant onboarding


  • MySQL → Stores tenant-specific data


  • NGINX → Routes traffic based on subdomain


  • Boto3 → Talks to AWS from Python



Let's dive in! 🏊‍♂️







🌐 Step 1 — Automate Subdomain Creation with Route 53



First, create a hosted zone in AWS Route 53 for your domain.





Install Boto3:





pip install boto3







Python Function to Create Subdomain:





import boto3

def create_subdomain(subdomain: str):
route53 = boto3.client('route53', region_name='ap-south-1')
hosted_zone_id = "ZXXXXXXXXXXX" # Replace with your Hosted Zone ID
domain_name = "example.com"

response = route53.change_resource_record_sets(
HostedZoneId=hosted_zone_id,
ChangeBatch={
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": f"{subdomain}.{domain_name}",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{"Value": "YOUR_SERVER_PUBLIC_IP"}]
}
}
]
}
)
return response





This automatically registers a new subdomain inside Route 53.







🛢️ Step 2 — Create Tenant Databases Dynamically



Each tenant gets a separate MySQL database for better isolation.




import mysql.connector

def create_tenant_db(tenant_name: str):
conn = mysql.connector.connect(
host="localhost",
user="root",
password="your_password"
)
cursor = conn.cursor()
cursor.execute(f"CREATE DATABASE IF NOT EXISTS {tenant_name}_db")
conn.commit()
conn.close()












⚡ Step 3 — FastAPI Endpoint for Tenant Signup



Whenever someone registers, we:




  1. Create their database

  2. Create their subdomain

  3. Return their live URL 🚀




from fastapi import FastAPI

app = FastAPI()

@app.post("/register")
async def register_tenant(tenant: str):
create_tenant_db(tenant)
create_subdomain(tenant)
return {"status": "success", "subdomain": f"{tenant}.example.com"}












🌍 Step 4 — Configure NGINX for Subdomains



We want all subdomains like client1.example.com or client2.example.com to hit the same backend, but serve different data.



Add this to your Nginx config:




server {
listen 80;
server_name ~^(?<subdomain>.+)\.example\.com$;

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}






Then reload NGINX:




sudo nginx -t
sudo systemctl reload nginx












🏗️ Final Architecture



Signup → FastAPI → Route 53 → NGINX → Tenant DB → Tenant-Specific App



This gives you:




  • ✅ Automatic subdomain creation

  • ✅ Automatic database provisioning

  • ✅ Scalable multi-tenant architecture









🎯 Conclusion



With AWS Route 53, FastAPI, MySQL, and NGINX, we built a SaaS-ready system that provisions subdomains and databases automatically.



This approach works great for multi-tenant apps, platforms, and SaaS dashboards — and saves hours of manual setup.






💡 Pro Tip: You can even take it further and integrate AWS ACM for automatic SSL certificates per subdomain.



What do you think? Would you like me to share a guide on auto SSL + HTTPS for all subdomains next? 🔐

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - 🚀 Automating Subdomains & Databases with AWS Route 53, FastAPI, and NGINX
id: 533a91d1-09fd-4dca-80d1-a010e65b687d
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "🚀 Automating Subdomains & Data" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Automating Subdomains  Databases with AW")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Automating Subdomains  Databases with AW*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Automating Subdomains  Databases with AW"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich 🚀 Automating Subdomains &amp; Databases with.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten 🚀 Automating Subdomains & Databases with AWS Route 53, FastAPI, and NGINX

Thematisch verwandte Begriffe: Automating, Subdomains, Databases, with · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97898 | Insecure Direct Object Reference / missing object-level authorization in…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag