# dokploy_pushover_notification (Resource)

A Pushover notification channel (Settings > Notifications). Dokploy sends each message through the Pushover API to a user or a group.

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 `user_key` in cleartext.** The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it. The `user_key_wo` companion keeps it out of the Terraform state.

~> **Dokploy stores and returns `api_token` in cleartext.** The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it. The `api_token_wo` companion keeps it out of the Terraform state.

## Example Usage

```terraform
# Emergency alerts through Pushover: priority 2 repeats every minute for an
# hour until someone acknowledges the message.
resource "dokploy_pushover_notification" "oncall" {
  name     = "on-call"
  priority = 2
  retry    = 60
  expire   = 3600

  user_key_wo          = var.pushover_user_key
  user_key_wo_version  = 1
  api_token_wo         = var.pushover_api_token
  api_token_wo_version = 1

  app_build_error  = true
  server_threshold = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Display name. Dokploy does not enforce a unique name.

### Optional

> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later.

- `api_token` (String, Sensitive) API token of the Pushover application. Set this attribute or `api_token_wo`.
- `api_token_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Write-only form of `api_token`. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one of `api_token` and `api_token_wo`. A new value reaches the server only when `api_token_wo_version` changes.
- `api_token_wo_version` (Number) Version of `api_token_wo`. Change it to send the current `api_token_wo` value to the server. It needs `api_token_wo`.
- `app_build_error` (Boolean) Send a message when a build fails. Defaults to `false`.
- `app_deploy` (Boolean) Send a message when an application or a compose deploys. Defaults to `false`.
- `database_backup` (Boolean) Send a message when a database backup runs. Defaults to `false`.
- `docker_cleanup` (Boolean) Send a message when the Docker cleanup runs. Defaults to `false`.
- `dokploy_backup` (Boolean) Send a message when the Dokploy server backup runs. Defaults to `false`.
- `dokploy_restart` (Boolean) Send a message when Dokploy restarts. Defaults to `false`.
- `expire` (Number) Seconds after which an emergency message stops repeating, 1 to 10800. Only for priority `2`.
- `priority` (Number) Message priority from `-2` (lowest) to `2` (emergency). Defaults to `0`. Priority `2` needs `retry` and `expire`.
- `retry` (Number) Seconds between repeats of an emergency message, 30 or more. Only for priority `2`.
- `server_threshold` (Boolean) Send a message when a server crosses a resource threshold. Defaults to `false`.
- `user_key` (String, Sensitive) User or group key from the Pushover dashboard. Set this attribute or `user_key_wo`.
- `user_key_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Write-only form of `user_key`. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one of `user_key` and `user_key_wo`. A new value reaches the server only when `user_key_wo_version` changes.
- `user_key_wo_version` (Number) Version of `user_key_wo`. Change it to send the current `user_key_wo` value to the server. It needs `user_key_wo`.
- `verify_connection` (Boolean) Test the connection with `notification.testPushoverConnection` before 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: `null` and `false` both skip the test. Dokploy stores no value for this attribute, so `terraform import` leaves it `null`. The test sends a real test message to the channel.
- `volume_backup` (Boolean) Send a message when a volume backup runs. Defaults to `false`.

### 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](https://developer.hashicorp.com/terraform/language/import) can be used with the `id` attribute, for example:

```terraform
import {
  to = dokploy_pushover_notification.oncall
  id = "INt_PYqh9apo8mmDIoixZ"
}
```

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import dokploy_pushover_notification.oncall INt_PYqh9apo8mmDIoixZ
```