---
title: "uptimeify_smtp_monitor"
description: "Ressource uptimeify_smtp_monitor: Beispiel, alle Attribute, Import."
---

<Callout>Die Beschreibungen auf dieser Seite kommen direkt aus dem Provider-Schema und sind deshalb englisch.</Callout>

An SMTP monitor: connects and authenticates (check_mode `protocol`) or only checks the port (`tcp`). The hostname must resolve to a public address. Import with the numeric id or the public id.

## Beispiel

```terraform
variable "smtp_password" {
  type      = string
  sensitive = true
}

resource "uptimeify_smtp_monitor" "this" {
  customer_id = 12
  name        = "Outgoing mail"
  hostname    = "mail.shop.example"
  port        = 587
  auth_user   = "monitor@shop.example"

  # Write-only: never stored in state. Bump the version to send a new password.
  auth_pass_wo         = var.smtp_password
  auth_pass_wo_version = 1
}
```

## Schema

### Pflichtfelder

- `customer_id` (Number) Customer the monitor belongs to. Changing it moves the monitor to another customer of the same organization in place.
- `hostname` (String) Host name or IP address only: no scheme, no path, no spaces.
- `name` (String) Display name, 1 to 255 characters.

### Optional

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

- `allow_duplicate` (Boolean, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Create the monitor even if the customer already has one of this type for the same target. Without it the create fails with 409 `monitorAlreadyExists` and the error names the import command for the existing monitor. Sent with create only.
- `allowed_check_country_codes` (Set of String) Upper-case ISO 3166-1 alpha-2 codes of the allowed check locations. Unset = all locations.
- `auth_pass_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) SMTP password. Required in check_mode `protocol`. Write-only (Terraform 1.11+ / OpenTofu 1.11+), never stored in state or returned by the API; sent on create and whenever the matching `*_wo_version` changes.
- `auth_pass_wo_version` (Number) Change this number to send `auth_pass_wo` again.
- `auth_user` (String) SMTP user. Required in check_mode `protocol`.
- `check_interval` (Number) Minutes between checks, 1 to 1440. Defaults to 30. The customer's package can require a larger minimum.
- `check_mode` (String) `protocol` (full login check, credentials required) or `tcp` (port reachability only; the API then stores no protocol settings and no credentials). Defaults to `protocol`.
- `ignore_tls` (Boolean) Do not upgrade with STARTTLS. Defaults to false.
- `management_type` (String) `managed` or `self_service`. Only organization writers choose it; customer tokens always get `self_service`. Defaults to `managed`.
- `port` (Number) TCP port. Unset = 465 with `secure`, else 25.
- `require_tls` (Boolean) Fail without STARTTLS. Defaults to false.
- `secure` (Boolean) Implicit TLS (SMTPS). Defaults to false.
- `status` (String) `active`, `maintenance` or `disabled`. Defaults to `active`.
- `timeout_seconds` (Number) Timeout per check in seconds, 1 to 60. Defaults to 30.

### Nur lesbar

- `created_at` (String)
- `id` (String) Numeric SMTP monitor id.
- `organization_id` (Number)
- `public_id` (String) Public UUID of the SMTP monitor.
- `updated_at` (String)

## Import

Import geht so:

Mit [`tofu import` bzw. `terraform import`](https://developer.hashicorp.com/terraform/cli/commands/import), zum Beispiel:

```shell
# Numeric id or public id
terraform import uptimeify_smtp_monitor.this 42
```
