Skip to main content

Cloud tools collection -- AWS infrastructure, CDN, and DevOps automation

Project description

Granny

Granny is a comprehensive Cloud DevOps toolkit designed to simplify and automate infrastructure management across multiple cloud providers. Built for developers and operations teams, Granny provides a unified command-line interface for managing AWS resources, CDN configurations, DNS records, storage solutions, and more.

What is Granny?

Granny is your Cloud Companion โ€” a collection of battle-tested tools that:

  • Analyzes AWS resources (VPCs, Lambda functions) across all regions
  • Manages Bunny CDN, including pull zones, cache purging, SSL certificates, and edge rules
  • Controls DNS records across multiple providers (Cloudflare, Bunny, Hetzner, deSEC, ClouDNS)
  • Provisions cloud infrastructure with reusable setup scripts
  • Builds multi-architecture Docker images with deterministic tagging
  • Deploys serverless functions to Scaleway FaaS
  • Handles object storage across AWS S3, Bunny Storage, and Hetzner S3
  • Manages email services (Mailjet sender setup, contact management, WorkMail users)
  • Supports Bunny Edge Scripting for advanced CDN customization

Whether you're managing a single project or orchestrating infrastructure across multiple cloud providers, Granny provides the tools you need in one cohesive package.

Features

Category Capabilities
Analysis List VPCs and Lambda functions across AWS regions
CDN Bunny CDN pull zone CRUD, cache purging, SSL certificates, edge rules
DNS Multi-provider DNS management (Cloudflare, Bunny, Hetzner, deSEC, ClouDNS)
Storage AWS S3, Bunny Storage, Hetzner S3 bucket and file management
Serverless Scaleway Functions (FaaS) deployment and management
Docker Multi-arch image builds with deterministic hash-based tagging
Email Mailjet DNS setup, contact management, AWS WorkMail user administration
Edge Bunny Edge Script creation, deployment, and environment management
Credentials Secure secret management with environment variable resolution
Infrastructure Reusable setup scripts for common cloud patterns

Quick Start

Installation

# Clone the repository
git clone https://github.com/your-org/granny-public.git
cd granny-public

# Install dependencies with uv
uv sync

# Or install globally from PyPI
pip install granny-devops

Tagged releases are published to both pypi.org and the public GitLab PyPI registry. If PyPI has not propagated a fresh release yet, use the GitLab registry fallback:

pip install --extra-index-url https://gitlab.com/api/v4/projects/81189862/packages/pypi/simple granny-devops

Configuration

Granny reads secrets from environment variables. Copy the example file and fill in the values:

cp .env.example .env

Edit .env with your API keys and credentials. The following environment variables are supported:

  • Bunny: BUNNY_API_KEY (plus per-customer BUNNY_API_KEY_<SLUG>)
  • Cloudflare: CLOUDFLARE_API_TOKEN
  • deSEC: DESEC_API_TOKEN
  • Hetzner DNS: HETZNER_DNS_API_TOKEN
  • Hetzner S3: HETZNER_S3_ACCESS_KEY, HETZNER_S3_SECRET_KEY
  • Scaleway: SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_DEFAULT_PROJECT_ID
  • Mailjet: MAILJET_API_KEY, MAILJET_SECRET_KEY
  • ClouDNS: CLOUDNS_AUTH_ID, CLOUDNS_AUTH_PASSWORD, CLOUDNS_SUB_AUTH_ID, CLOUDNS_SUB_AUTH_USER
  • Docker Hub: DOCKER_HUB_USER, DOCKER_HUB_TOKEN

Basic Usage

# Get help for all commands
granny --help

# Analyze AWS resources
granny analyze vpcs              # List all VPCs across regions
granny analyze lambdas          # List all Lambda functions

# Manage Bunny CDN
granny cdn purge 12345           # Purge cache for pull zone 12345
granny cdn list-zones          # List all pull zones
granny cdn create-zone my-zone  # Create a new pull zone

# Manage DNS records
granny dns list --domain example.com --provider cloudflare

granny dns add api.example.com --type A --provider hetzner

# Manage storage
granny storage bunny list      # List Bunny storage zones
granny storage aws create my-bucket --website

# Build Docker images
granny docker build-base --image myapp-base --hash-file requirements.txt

# Deploy serverless functions
granny serverless deploy my-function --source-dir ./dist

# Manage credentials
granny credentials status       # Show which secrets are configured
granny credentials get BUNNY_API_KEY

CLI Command Reference

For detailed documentation of all CLI commands, see the Documentation section below.

Use Cases

1. Multi-Cloud Infrastructure Analysis

Quickly audit your AWS resources across all regions without logging into the console:

# List all VPCs with their CIDR blocks and regions
granny analyze vpcs --json-output

# Find all Lambda functions with their runtimes
granny analyze lambdas --region us-east-1 eu-west-1

2. CDN Management

Manage Bunny CDN pull zones, cache, and SSL certificates:

# Purge cache for a specific pull zone
granny cdn purge 12345

# List all pull zones
granny cdn list-zones

# Create a new pull zone with origin
granny cdn create-zone "My Website" --origin-url https://my-origin.com

# Add a custom hostname
granny cdn add-hostname 12345 www.example.com

# Request SSL certificate
granny cdn ssl www.example.com --dns01

3. DNS Management

Manage DNS records across multiple providers with a unified interface:

# List all records for a domain
granny dns list --domain example.com --provider cloudflare

# Add an A record (auto-detects public IP)
granny dns add api.example.com --provider hetzner --domain example.com

# Add a CNAME record
granny dns add www.example.com --type CNAME --value example.com --provider bunny

# Delete a record
granny dns delete old.example.com --type A --provider cloudflare --yes

4. Storage Management

Work with object storage across AWS S3, Bunny Storage, and Hetzner:

# Create a Bunny storage zone
granny storage bunny create my-assets --region DE

# Upload a file
granny storage bunny upload my-zone ./assets/image.png --password my-password

# Create an S3 bucket with website hosting
granny storage aws create my-website --website

# Create a Hetzner S3 bucket
granny storage hetzner create my-bucket --region fsn1 --public

5. Serverless Deployments

Deploy functions to Scaleway FaaS:

# Create a namespace
granny serverless create-namespace my-app

# Create a function
granny serverless create-function my-namespace my-function --runtime node20

# Deploy code
granny serverless deploy my-function --source-dir ./dist --namespace my-app

6. Docker Builds

Build and push multi-architecture Docker images:

# Build a base image with hash-based tagging
granny docker build-base \
  --image myapp-base \
  --hash-file requirements.txt \
  --hash-file package.json \
  --secret npmtoken=NPM_TOKEN \
  --login-docker-hub

7. Email Management

Configure Mailjet and AWS WorkMail:

# Setup Mailjet DNS for a domain
granny email mailjet setup-dns example.com

# Check Mailjet contact status
granny email mailjet check-contact user@example.com

# List WorkMail users
granny email workmail list-users example.com

# Create a WorkMail user
granny email workmail create-user example.com --email user@example.com --display-name "John Doe"

Documentation

Full documentation is available in the docs/ directory:

Standalone Scripts

The granny/create/ directory contains standalone setup scripts for various cloud services:

  • setup_aws_cloudfront.py โ€” Setup AWS CloudFront with security headers
  • setup_bunny_edge_script.py โ€” Configure Bunny Edge Scripting
  • setup_bunny_storage.py โ€” Setup Bunny Storage
  • setup_cognito_identity_pool.py โ€” Create Cognito identity pools
  • setup_hetzner_bunny.py โ€” Hetzner + Bunny integration
  • setup_mailjet_dns.py โ€” Configure Mailjet DNS settings
  • setup_private_cdn.py โ€” Setup private CDN
  • setup_s3_website.py โ€” Configure S3 website hosting
  • setup_scaleway_faas.py โ€” Setup Scaleway Functions
  • setup_workmail.py โ€” Setup AWS WorkMail
  • manage_mailjet_contacts.py โ€” Manage Mailjet contacts
  • auto_certificate.py โ€” SSL certificate automation

Run them directly:

python -m granny.create.setup_s3_website example.com --help

Or via the CLI:

granny create s3-website example.com --help

Project Structure

granny/
โ”œโ”€โ”€ cli/              # CLI command modules
โ”‚   โ”œโ”€โ”€ analyze.py     # AWS resource analysis
โ”‚   โ”œโ”€โ”€ cdn.py        # Bunny CDN management
โ”‚   โ”œโ”€โ”€ create.py     # Infrastructure provisioning
โ”‚   โ”œโ”€โ”€ credentials.py # Secret management
โ”‚   โ”œโ”€โ”€ docker.py     # Docker build commands
โ”‚   โ”œโ”€โ”€ dns.py        # DNS management
โ”‚   โ”œโ”€โ”€ edge.py       # Bunny Edge Scripting
โ”‚   โ”œโ”€โ”€ email.py      # Email management
โ”‚   โ”œโ”€โ”€ main.py       # CLI entrypoint
โ”‚   โ”œโ”€โ”€ serverless.py # Serverless functions
โ”‚   โ””โ”€โ”€ storage.py    # Storage management
โ”œโ”€โ”€ analyze/          # AWS analysis modules
โ”œโ”€โ”€ cdn/              # CDN provider modules
โ”œโ”€โ”€ create/           # Setup scripts
โ”œโ”€โ”€ credentials/      # Secret management
โ”œโ”€โ”€ dns/              # DNS provider modules
โ”œโ”€โ”€ docker/           # Docker build utilities
โ”œโ”€โ”€ edge/             # Edge Scripting modules
โ”œโ”€โ”€ email/            # Email service modules
โ”œโ”€โ”€ serverless/       # Serverless provider modules
โ”œโ”€โ”€ storage/          # Storage provider modules
โ””โ”€โ”€ report.py         # Reporting utilities

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (uv run pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

Support

For issues, questions, or feature requests:

  • Open an issue on GitHub
  • Check the documentation for detailed guides
  • Run granny --help or granny <command> --help for CLI usage

Granny โ€” Making cloud infrastructure management simple again.

Built with โค๏ธ by Martin Wieser and contributors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

granny_devops-0.5.0.tar.gz (197.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

granny_devops-0.5.0-py3-none-any.whl (232.4 kB view details)

Uploaded Python 3

File details

Details for the file granny_devops-0.5.0.tar.gz.

File metadata

  • Download URL: granny_devops-0.5.0.tar.gz
  • Upload date:
  • Size: 197.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for granny_devops-0.5.0.tar.gz
Algorithm Hash digest
SHA256 175a389f3e8a47048a41e890e0ddea13bdbb00ac51e994ffa0867b822db04eba
MD5 d274d30609129ed748c906d893cfbfbc
BLAKE2b-256 e706cecc0a209dfd049b51c1352a6a27e7dd1c9df3604e09651b4fc21fceda7b

See more details on using hashes here.

File details

Details for the file granny_devops-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: granny_devops-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 232.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for granny_devops-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9241d529de97f868823d869a09f8b0cb61e0560119dd73616a6888840f5fddc2
MD5 d7089fadd62b884825e512be0ac2cac4
BLAKE2b-256 13e564acdc7dacaeef90d249bbd41f504cf1d0b84a6636b88dc08b3560b1a07d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page