This provider can be used to manage Caddy configurations.
- Download a binary from the release section.
- Install it into the user plugins directory.
- Windows:
%APPDATA%\terraform.d\plugins
- other OS:
~/.terraform.d/plugins
- Windows:
resource "caddy_server_block" "my-server" {
filename = "test.conf"
content = <<EOF
my-server.com {
respond "Hello, world!"
}
sub.my-server.com {
respond "Hello, world!"
}
EOF
}
The file will be stored inside the configured folder.
In addition to generic provider
arguments (e.g. alias
and version
), the following arguments are supported in the Nginx provider block:
config_folder
- (Optional) Folder where all configurations are stored. Default:/etc/caddy/conf.d