Skip to main content

InfraDSL

The Rails of Modern Infrastructure - Enterprise DSL for Infrastructure Management

PyPI version Python Versions License: MIT

InfraDSL is a next-generation Infrastructure as Code (IaC) tool that brings Rails-like conventions and chainable APIs to cloud infrastructure management. It combines the simplicity of Python with powerful multi-cloud capabilities, intelligent caching, and self-healing infrastructure.

✨ Key Features

  • 🚀 Rails-like DSL: Chainable, intuitive APIs that feel natural to developers
  • ☁️ Multi-Cloud Native: AWS, GCP, Azure, DigitalOcean support with unified syntax
  • 🧠 Intelligent Import: Superior import system with dependency analysis and fingerprint-based caching
  • ⚡ Performance First: PostgreSQL-backed caching, parallel execution, and smart resource detection
  • 🔄 Self-Healing: Automatic drift detection and remediation with customizable policies
  • 📊 Enterprise Ready: RBAC, audit logging, cost optimization, and compliance features

🚀 Quick Start

Installation

pip install infradsl

Basic Example

from infradsl import AWS

# Create a simple web server with Rails-like chainability
vm = (AWS.EC2("web-server")
      .instance_type("t3.micro")
      .ubuntu_24_04()
      .key_pair("my-key")
      .security_group("web-sg")
      .public_ip()
      .production())

# Create VPC with intelligent defaults
vpc = (AWS.VPC("main-vpc")
       .cidr("10.0.0.0/16")
       .enable_dns()
       .multi_az()
       .production())

# CloudFront CDN with S3 origin
cdn = (AWS.CloudFront("website-cdn")
       .s3_origin("my-website-bucket")
       .custom_domain("www.example.com")
       .ssl_certificate("arn:aws:acm:...")
       .gzip_compression()
       .production())

CLI Usage

# Initialize a new project
infra init myproject

# Import existing infrastructure
infra import aws --region us-east-1

# Preview changes
infra preview infrastructure.py

# Apply changes
infra apply infrastructure.py --production

# Monitor drift and auto-heal
infra heal start --auto-remediate

🏗️ Architecture

InfraDSL is built on several core principles:

1. Rails-like Conventions

  • Convention over Configuration: Intelligent defaults for common patterns
  • Chainable APIs: Fluent interfaces that read like natural language
  • Environment Presets: .production(), .staging(), .development() with optimized settings

2. Superior Import System

  • Dependency-Aware: Automatically resolves resource relationships
  • Fingerprint Caching: PostgreSQL-backed cache for instant resource recognition
  • Intelligent Organization: Groups imported resources by function and dependencies

3. Multi-Cloud Abstraction

# Same API across all clouds
AWS.VirtualMachine("web").ubuntu().production()
GCP.VirtualMachine("web").ubuntu().production() 
Azure.VirtualMachine("web").ubuntu().production()

📚 Documentation

🌟 Examples

Multi-Cloud Application

from infradsl import AWS, GCP

# AWS Infrastructure
app_server = (AWS.EC2("app")
              .instance_type("t3.medium")
              .ubuntu_24_04()
              .auto_scaling_group(2, 10)
              .production())

# GCP Database
database = (GCP.CloudSQL("app-db")
            .postgres_15()
            .high_availability()
            .backup_schedule("0 2 * * *")
            .production())

# Cross-cloud networking automatically configured

Static Website with CDN

from infradsl import AWS

# Website bucket
website = (AWS.S3("my-website")
           .website("index.html", "404.html")
           .public_read()
           .production())

# Global CDN
cdn = (AWS.CloudFront("website-cdn")
       .s3_origin("my-website")
       .custom_domain("www.example.com")
       .ssl_certificate("arn:aws:acm:...")
       .price_class_all()
       .production())

# DNS routing
dns = (AWS.Route53("example-dns")
       .use_existing_zone("example.com")
       .cloudfront_alias("www", cdn)
       .production())

Self-Healing Infrastructure

from infradsl import AWS, DriftAction

# Auto-healing web servers
web_servers = (AWS.EC2("web-cluster")
               .instance_type("t3.medium")
               .auto_scaling_group(3, 20)
               .health_check_grace_period(300)
               .drift_policy(DriftAction.AUTO_HEAL)
               .production())

# Automatic failover database
database = (AWS.RDS("app-db")
            .postgres_15()
            .multi_az()
            .backup_retention(30)
            .drift_policy(DriftAction.ALERT_AND_HEAL)
            .production())

🔧 Advanced Features

Import Existing Infrastructure

# Import AWS resources with dependency analysis
infra import aws --region us-east-1 --analyze-dependencies

# Import specific resource types
infra import gcp --project my-project --resources compute,storage

# Import with custom organization
infra import aws --organize-by environment,function

Intelligent Caching

# View cache statistics
infra cache stats

# Clear and rebuild cache
infra cache clear --rebuild

# Cache performance metrics
infra cache analyze --performance

Cost Optimization

# Built-in cost optimization
vm = (AWS.EC2("web")
      .cost_optimized()  # Automatically selects best instance type
      .spot_instances()   # Use spot instances when possible
      .production())

# Cost insights
infra insights cost --forecast 30d

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/infradsl/infradsl.git
cd infradsl
pip install -e ".[dev]"
pre-commit install

Running Tests

pytest
pytest --cov=infradsl --cov-report=html

📄 License

InfraDSL is released under the MIT License.

🆘 Support

🗺️ Roadmap

  • ✅ Multi-cloud resource management (AWS, GCP, Azure, DigitalOcean)
  • ✅ Superior import system with dependency analysis
  • ✅ PostgreSQL-backed intelligent caching
  • ✅ Self-healing infrastructure capabilities
  • 🚧 Kubernetes native integration
  • 🚧 Terraform migration tools
  • 🚧 Advanced security scanning
  • 🚧 GitOps integration

Made with ❤️ by the InfraDSL Team

InfraDSL - Infrastructure as Code, Redefined

Metadata

Release files for infradsl 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infradsl 0.1.5
File Size Uploaded Provenance Actions
infradsl-0.1.5.tar.gz 613.5 kB Without provenance Details for infradsl-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for infradsl 0.1.5
File Interpreter ABI Platform Actions
infradsl-0.1.5-py3-none-any.whl Python 3 none any Details for infradsl-0.1.5-py3-none-any.whl

Total release size: 1.4 MB

Release files / infradsl-0.1.5.tar.gz

Download URL infradsl-0.1.5.tar.gz
Size 613.5 kB
Tags Source
SHA-256 checksum
How to use checksums
61c8eb61bf4f06b1cedd6905ceb383ed12e9bdc5b457644bc927762b67e5f0b2
BLAKE2b-256 checksum
How to use checksums
405d2bac46d0870fa285784bc4fc0e9e2325ad2af78c94c148ba278d4f783fbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / infradsl-0.1.5-py3-none-any.whl

Download URL infradsl-0.1.5-py3-none-any.whl
Size 767.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0bad61921e9b100f4990afb2b756b00e6b832333881de55636329397713f4e6
BLAKE2b-256 checksum
How to use checksums
38755ad42a2d1d987f8297dddbd22be516d1ee32ebda7b1cce6a72ae7b1d91d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for infradsl 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page