Provider for managing https://dkron.io/ jobs.
terraform {
required_providers {
dkron = {
version = "0.2"
source = "registry.terraform.io/bozerkins/dkron"
}
}
}
provider "dkron" {
host = "http://localhost:8080"
}
resource "dkron_job" "job1" {
name = "job1"
timezone = "Europe/Riga"
executor = "shell"
command = "date"
env = "EDITOR=vi"
cwd = ""
shell = false
allowed_exitcodes = "0, 199, 255"
schedule = "@every 10m"
timeout = "9s"
mem_limit_kb = "16384"
project = "myproject"
disabled = false
retries = 5
concurrency = "forbid"
tags = {
"myproject" = "dumdum:2"
}
# out to fluent
processors {
type = "fluent"
}
}
resource "dkron_job" "job2" {
name = "job2"
timezone = "Europe/Riga"
executor = "shell"
command = "date"
env = "ENV1=envone"
cwd = ""
shell = false
allowed_exitcodes = "0, 199, 255"
schedule = "@every 10m"
timeout = "9s"
mem_limit_kb = "16384"
project = "myproject"
disabled = false
retries = 5
concurrency = "forbid"
tags = {
"myproject" = "dumdum"
}
processors {
type = "log"
}
}
Dkron API is poorly documented and doesn't always work as in documentation. Because of that some inconsistencies may arise
Processors order doesn't really work, so using more than one processor isn't advised. This happens because of how Go serializes JSON and how Dkron Job API works.
This provider is based on https://github.com/peertransfer/terraform-provider-dkron provider
Special thank to https://github.com/andreygolev for improving the initial provider
Run the following command to build the provider
go build -o terraform-provider-dkron
First, build and install the provider.
make install
Then, run the following command to initialize the workspace and apply the sample configuration.
terraform init && terraform apply