Why creating this ?
OpenTofu is used to manage resources that have lifecycles, configurations, to sum it up.
That is the case of CTFd: it handles challenges that could be created, modified and deleted.
With some work to leverage the unsteady CTFd's API, OpenTofu is now able to manage them as cloud resources bringing you to opportunity of CTF as Code.
It avoids shitty scripts, ctfcli and other tools that does not solve the problem of reproductibility, ease of deployment and resiliency.
How to use it ?
With the OpenTofu Provider for CTFd, you could setup your CTFd challenge using the following configuration.
resource "ctfd_challenge" "my_challenge" {
name = "My Challenge"
category = "Some category"
description = <<-EOT
My superb description !
And it's multiline :o
EOT
state = "visible"
value = 500
}