This project aims to create a terraform provider (named "uptime-kuma" in terraform code) for the Uptime-Kuma selfhosted monitoring system.
This repository is built on the Terraform Plugin Framework. The template repository built on the Terraform Plugin SDK can be found at terraform-provider-scaffolding and is used as the basis for this project.
This project has not yet been published to the Terraform Registry. See instructions below for local development/usage.
This project's current goal is not to get a working provider. Without the official API, and the webapi layer in use being over a year out of development and showing some bugs, it is unlikely to have a working provider. For now, the goal is to create the framework for when the official API is released, with focuses on creating schemas and resources setup for later use.
- Terraform >= 1.0
- Go >= 1.22
- Docker and Docker Compose
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
installcommand:
go installThis provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency to your Terraform provider:
go get github.com/author/dependency
go mod tidyThen commit the changes to go.mod and go.sum.
See Prepare Terraform for local provider install for information on how to point your Terraform binary to your local build
for development (using the ~/.terraformrc file).
While not published yet, the registry url will probably be hashicorp.com/theodoreherzfeld/uptime-kuma.
Start by setting up the docker-compose.yml file:
- set
KUMA_USERNAMEandKUMA_PASSWORDto what you INTEND to use as the login credentials for your development uptime-kuma instance - run
docker compose upto start the development environment. Connect to the development uptime-kuma instance atlocalhost:3069and setup the admin account - connect to the webapi at
localhost:8000for information about the API during development - ?
- profit!
Until the official API is released, the provider configuration should point to the API, not directly to the uptime-kuma instance. The credentials
for access are set by the environment variables attached to the API service in docker-compose.yml.
To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.
To generate or update documentation, run make generate.
In order to run the full suite of Acceptance tests, run make testacc.
make testacc- github actions, publish to registry (probably gonna wait a while on this)
Provider:
- password-based login
Data sources:
- user
Resources:
- monitor - broken as hell - suspect issues with the API layer