Skip to content

About

Terraform provider for https://github.com/0xfurai/peekaping

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

65 Commits

Folders and files

Repository files navigation

πŸš€ Terraform Provider for Peekaping

The most comprehensive Terraform provider for Peekaping monitoring infrastructure

Terraform Registry GitHub stars Support on Ko-fi License Version Go

Monitor Types Resources Peekaping

🌟 Show Your Support

If this project helped you, please consider giving it a ⭐!

GitHub stars GitHub forks GitHub watchers


✨ Features & Capabilities

πŸš€ Key Features

  • 🎯 Complete Infrastructure as Code - Full CRUD operations, state management, and import support
  • πŸ” Enterprise Security - 2FA support, secure credentials, and environment variable management
  • πŸ“Š Rich Monitoring - 18 monitor types with JSON configuration and advanced scheduling
  • 🎨 Status Pages - Public status pages with custom themes and real-time updates
  • πŸ”” Smart Notifications - Multiple channels with flexible routing and default settings
  • 🏷️ Organization - Tag-based organization, maintenance windows, and proxy support

πŸ”§ Resources

  • peekaping_monitor - Create and manage monitoring checks (HTTP, HTTP-keyword, HTTP-JSON-query, TCP, Ping, DNS, Push, Docker, gRPC-keyword, SNMP, MongoDB, MySQL, PostgreSQL, SQL Server, Redis, MQTT, RabbitMQ, Kafka Producer)
  • peekaping_notification - Configure notification channels (Email, webhook, custom channels)
  • peekaping_tag - Organize monitors with tags (All monitor types)
  • peekaping_maintenance - Schedule maintenance windows (All monitor types)
  • peekaping_status_page - Create public status pages (All monitor types)
  • peekaping_proxy - Configure proxy settings (All monitor types)

πŸ“‹ Data Sources

  • peekaping_monitor - Query existing monitors (Find monitors by name, type, or tags)
  • peekaping_notification - Query notification channels (Discover available notification channels)
  • peekaping_tag - Query tags (Lookup tags and their configurations)
  • peekaping_maintenance - Query maintenance windows (Find scheduled maintenance periods)
  • peekaping_status_page - Query status pages (Discover existing status pages)
  • peekaping_proxy - Query proxy configurations (Find available proxy settings)

πŸ“¦ Installation & Setup

Option 1: Terraform Registry (Recommended)

Add the provider to your Terraform configuration:

terraform {
  required_providers {
    peekaping = {
      source  = "tafaust/peekaping"
      version = "~> 0.2.1"
    }
  }
}

Then run:

terraform init

Option 2: Local Development

For development or testing with the latest changes:

  1. Clone and build:

    git clone https://github.com/tafaust/terraform-provider-peekaping
    cd terraform-provider-peekaping
    go build -o terraform-provider-peekaping
  2. Configure Terraform (~/.terraformrc):

    provider_installation {
      dev_overrides {
        "tafaust/peekaping" = "/path/to/terraform-provider-peekaping"
      }
      direct {}
    }
  3. Initialize:

    terraform init

πŸ”§ Provider Configuration

Configure the provider in your Terraform files:

provider "peekaping" {
  endpoint = "https://api.peekaping.com"  # Your Peekaping instance URL
  email    = "your-email@example.com"     # Your Peekaping email
  password = "your-password"              # Your Peekaping password
  token    = "123456"                     # 2FA token (if 2FA is enabled)
}

Environment Variables (Alternative to provider config):

export PEEKAPING_ENDPOINT="https://api.peekaping.com"
export PEEKAPING_EMAIL="your-email@example.com"
export PEEKAPING_PASSWORD="your-password"
export PEEKAPING_TOKEN="123456"  # 2FA token

πŸ“š Examples & Use Cases

🎯 Real-World Examples

Example Description Complexity
Simple Basic HTTP monitor setup ⭐ Beginner
Comprehensive Full monitoring stack ⭐⭐⭐ Advanced
Full Lifecycle Complete workflow demo ⭐⭐ Intermediate

πŸš€ Quick Examples

HTTP Monitor with Notifications:

resource "peekaping_monitor" "api" {
  name = "API Health Check"
  type = "http"
  config = jsonencode({
    url = "https://api.example.com/health"
    method = "GET"
    headers = {
      "Authorization" = "Bearer ${var.api_token}"
    }
  })
  interval = 30
  timeout  = 10
}

resource "peekaping_notification" "email" {
  name = "Team Alerts"
  type = "email"
  config = jsonencode({
    emails = ["team@example.com"]
  })
}

Database Monitoring:

resource "peekaping_monitor" "postgres" {
  name = "PostgreSQL Database"
  type = "postgresql"
  config = jsonencode({
    hostname = "db.example.com"
    port     = 5432
    username = "monitor"
    password = var.db_password
    database = "app_db"
  })
}

πŸ§ͺ Testing & Validation

Running Tests

# Run all tests
go test ./...

# Run with coverage
go test -cover ./...

# Run specific test
go test ./internal/provider -run TestResourceMonitor

Example Validation

# Validate examples
cd examples/simple
terraform init
terraform plan
terraform apply

# Test comprehensive setup
cd examples/comprehensive
terraform init
terraform plan
terraform apply

πŸ› οΈ Development

Project Structure

β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ peekaping/          # API client implementation
β”‚   └── provider/           # Terraform provider resources
β”œβ”€β”€ examples/               # Real-world usage examples
β”œβ”€β”€ docs/                   # Comprehensive documentation
β”œβ”€β”€ tools/                  # Development tools
└── main.go                 # Provider entry point

Building

# Build the provider
go build -o terraform-provider-peekaping

# Build for multiple platforms
GOOS=linux GOARCH=amd64 go build -o terraform-provider-peekaping-linux
GOOS=windows GOARCH=amd64 go build -o terraform-provider-peekaping-windows.exe

Development Workflow

# 1. Make changes to the code
# 2. Run tests
go test ./...

# 3. Build the provider
go build -o terraform-provider-peekaping

# 4. Test with examples
cd examples/simple
terraform init
terraform plan
terraform apply

πŸ“ Known Limitations

  • 2FA Token Expiration: 2FA tokens expire quickly and need frequent updates during development
  • JSON Formatting: Monitor config JSON is normalized for consistency across different monitor types

🀝 Contributing

We love contributions! This project thrives on community input and collaboration.

🌟 Ways to Contribute

Contribution Type Description Impact
πŸ› Bug Reports Found an issue? Let us know! High
πŸ’‘ Feature Requests Have an idea? We'd love to hear it! High
πŸ“ Documentation Improve examples, docs, or README Medium
πŸ”§ Code Contributions Fix bugs or add features High
πŸ§ͺ Testing Add tests or improve coverage Medium
πŸ“’ Community Help others, answer questions High

πŸš€ Getting Started

  1. ⭐ Star this repository - It helps others discover the project!
  2. 🍴 Fork the repository
  3. 🌿 Create a feature branch: git checkout -b feature/amazing-feature
  4. πŸ’» Make your changes
  5. βœ… Add tests for new functionality
  6. πŸ“ Update documentation if needed
  7. πŸ”„ Submit a pull request

🎯 Contribution Guidelines

  • Code Style: Follow Go conventions and run gofmt
  • Testing: Add tests for new features and bug fixes
  • Documentation: Update README and examples as needed
  • Commit Messages: Use clear, descriptive commit messages
  • Pull Requests: Provide a clear description of changes

πŸ’¬ Community

  • Discussions: Use GitHub Discussions for questions and ideas
  • Issues: Report bugs and request features
  • Pull Requests: Submit code improvements

Every contribution matters! Whether you're fixing a typo or adding a new monitor type, your help makes this project better for everyone.

πŸ†˜ Support & Community

Resource Description Link
πŸ“š Documentation Complete API reference and guides docs/
πŸ’‘ Examples Real-world usage examples examples/
πŸ› Bug Reports Found an issue? Let us know! GitHub Issues
πŸ’¬ Discussions Questions and community chat GitHub Discussions
πŸ“– Terraform Registry Official provider documentation Registry

🎯 Roadmap & Status

βœ… Completed Features

  • All Core Resources - Monitors, notifications, tags, maintenance, status pages, proxies
  • Data Sources - Query existing resources
  • 18 Monitor Types - Comprehensive monitoring coverage
  • 2FA Support - Enhanced security
  • Terraform Registry - Official provider distribution
  • Comprehensive Examples - Real-world usage patterns
  • Production Testing - Battle-tested reliability

🚧 In Progress

  • API Key Authentication - Alternative auth method (PR merged)
  • Enhanced Error Handling - Better user experience

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Made with ❀️ by the community, for the community

Made with Go Powered by Terraform

About

Terraform provider for https://github.com/0xfurai/peekaping

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages