dokploy_discord_notification (Resource)
A Discord notification channel (Settings > Notifications). Dokploy posts each message to a channel webhook.
Each event attribute selects one Dokploy event that sends a message on this channel. All events default to false, so a new channel sends nothing until you enable one.
~> Dokploy does not test the channel on create or update. A wrong URL or token applies successfully and fails on the first message. Set verify_connection = true to test the channel before the write.
~> Dokploy stores and returns webhook_url in cleartext. The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it. The webhook_url_wo companion keeps it out of the Terraform state.
Example Usage
# Post every backup result to a Discord channel, as a plain message.
resource "dokploy_discord_notification" "backups" {
name = "backups"
webhook_url = var.discord_webhook_url
decoration = false
database_backup = true
volume_backup = true
dokploy_backup = true
}Schema
Required
name(String) Display name. Dokploy does not enforce a unique name.
Optional
NOTE: Write-only arguments are supported in Terraform 1.11 and later.
app_build_error(Boolean) Send a message when a build fails. Defaults tofalse.app_deploy(Boolean) Send a message when an application or a compose deploys. Defaults tofalse.database_backup(Boolean) Send a message when a database backup runs. Defaults tofalse.decoration(Boolean) Send the message as a rich embed with colors and the Dokploy icon. Defaults totrue.docker_cleanup(Boolean) Send a message when the Docker cleanup runs. Defaults tofalse.dokploy_backup(Boolean) Send a message when the Dokploy server backup runs. Defaults tofalse.dokploy_restart(Boolean) Send a message when Dokploy restarts. Defaults tofalse.server_threshold(Boolean) Send a message when a server crosses a resource threshold. Defaults tofalse.verify_connection(Boolean) Test the connection withnotification.testDiscordConnectionbefore the provider creates or updates the record. If the test fails, the apply fails with the server message, and the provider writes nothing. The default is no check:nullandfalseboth skip the test. Dokploy stores no value for this attribute, soterraform importleaves itnull. The test sends a real test message to the channel.volume_backup(Boolean) Send a message when a volume backup runs. Defaults tofalse.webhook_url(String, Sensitive) Webhook URL of the Discord channel. Set this attribute orwebhook_url_wo.webhook_url_wo(String, Sensitive, Write-only) Write-only form ofwebhook_url. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one ofwebhook_urlandwebhook_url_wo. A new value reaches the server only whenwebhook_url_wo_versionchanges.webhook_url_wo_version(Number) Version ofwebhook_url_wo. Change it to send the currentwebhook_url_wovalue to the server. It needswebhook_url_wo.
Read-Only
created_at(String) Creation timestamp from the server.id(String) Notification id.
Import
Import is supported using the following syntax:
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
import {
to = dokploy_discord_notification.backups
id = "INt_PYqh9apo8mmDIoixZ"
}The terraform import command can be used, for example:
terraform import dokploy_discord_notification.backups INt_PYqh9apo8mmDIoixZ