Skip to content

plain-insure/terraform-provider-cronjoborg

Terraform Provider for cron-job.org

Tests Release

This provider allows you to manage jobs, folders, and status pages using the cron-job.org API or a compatible self-hosted service.

Requirements

  • Terraform >= 1.0
  • Go >= 1.20 (for building from source)

Installation

From the Terraform Registry

terraform {
  required_providers {
    cronjoborg = {
      source  = "plain-insure/cronjoborg"
      version = "~> 1.0"
    }
  }
}

From Source

git clone https://github.com/plain-insure/terraform-provider-cronjoborg.git
cd terraform-provider-cronjoborg
make build
make install

Usage

Provider Configuration

provider "cronjoborg" {
  api_url = "https://api.cron-job.org/"  # Optional, defaults to cron-job.org API
  api_key = var.cron_job_api_key         # Required, or set CRON_JOB_API_KEY env var
}

Basic Example

# Create a folder
resource "cronjoborg_folder" "monitoring" {
  title = "Monitoring Jobs"
}

# Create a cron job
resource "cronjoborg_job" "health_check" {
  title = "Health Check"
  url   = "https://example.com/health"
}

# Create a status page
resource "cronjoborg_status_page" "uptime" {
  title = "Service Uptime"
}

For more examples, see the examples/ directory.

Authentication

The provider requires an API key from cron-job.org. You can obtain one by:

  1. Creating an account at cron-job.org
  2. Generating an API key in your account settings

Set the API key using one of these methods:

Environment Variable (Recommended)

export CRON_JOB_API_KEY="your-api-key-here"

Provider Configuration

provider "cronjoborg" {
  api_key = "your-api-key-here"
}

Variable

variable "cron_job_api_key" {
  description = "API key for cron-job.org"
  type        = string
  sensitive   = true
}

provider "cronjoborg" {
  api_key = var.cron_job_api_key
}

Resources

  • cronjoborg_job - Manages cron jobs
  • cronjoborg_folder - Manages folders for organizing jobs
  • cronjoborg_status_page - Manages status pages

Documentation

Full documentation is available on the Terraform Registry.

Development

See CONTRIBUTING.md for development setup and contribution guidelines.

Quick Start for Development

# Clone the repository
git clone https://github.com/plain-insure/terraform-provider-cronjoborg.git
cd terraform-provider-cronjoborg

# Install development tools
make dev-setup

# Build the provider
make build

# Run tests
make test

# Install locally for testing
make install

Available Make Targets

Run make help to see all available targets:

make help

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Support

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages