Terraform
Use the API from infrastructure-as-code workflows.
Terraform module
Create canaries from infrastructure-as-code workflows and pass the returned ping URL into scheduled jobs.
- Configure the generic Mastercard/restapi provider with your Canaries API key.
- Use the registry module to create one canary per scheduled job.
- Pass the sensitive ping URL output into the job definition.
- Keep the ping command after the work that must succeed.
provider "restapi" {
uri = "https://tools.devops.care"
write_returns_object = true
id_attribute = "id"
headers = {
Authorization = "Api-Key ${var.devops_care_api_key}"
Content-Type = "application/json"
}
}
module "daily_backup_canary" {
source = "devops-care/canary/restapi"
name = "daily-backup"
max_survival_interval = "1 00:00:00"
}