jianyuan/terraform-provider-porkbun
tldr.page
Email Forward

generated by https://github.com/hashicorp/terraform-plugin-docs

page_title: "porkbun_email_forward Resource - terraform-provider-porkbun" subcategory: "" description: |- Manages an email forward for a domain. Porkbun identifies a forward by address plus forward_to; every argument forces replacement. Adding a forward sets Porkbun's MX records and SPF include at the zone apex of the domain's Porkbun DNS. If that would delete other apex MX records or rewrite an existing SPF record, creation fails unless confirm_dns_changes is true. Deleting the last forward of a domain also removes Porkbun's forwarding MX and SPF records; this cannot be opted out of.

porkbun_email_forward (Resource)

Manages an email forward for a domain. Porkbun identifies a forward by address plus forward_to; every argument forces replacement.

Adding a forward sets Porkbun's MX records and SPF include at the zone apex of the domain's Porkbun DNS. If that would delete other apex MX records or rewrite an existing SPF record, creation fails unless confirm_dns_changes is true. Deleting the last forward of a domain also removes Porkbun's forwarding MX and SPF records; this cannot be opted out of.

Example Usage

resource "porkbun_email_forward" "hello" {
  domain     = "example.com"
  address    = "hello" # the part before the @
  forward_to = "me@example.org"
}

# Allow Porkbun to delete other apex MX records and rewrite an existing SPF
# record when setting up forwarding.
resource "porkbun_email_forward" "info" {
  domain              = "example.com"
  address             = "info"
  forward_to          = "me@example.org"
  confirm_dns_changes = true
}

Schema

Required

  • address (String) The address to forward: the part before the @ (hello) or the whole address (hello@example.com). Both forms are treated as the same address.
  • domain (String) (Force new) The domain to forward email for.
  • forward_to (String) (Force new) The mailbox to deliver to.

Optional

  • confirm_dns_changes (Boolean) Agree to the DNS changes Porkbun needs to make at the zone apex, such as deleting other MX records or rewriting an existing SPF record. When false (the default) and confirmation is required, creation fails and lists the changes. This only affects creation and is not read back from the API. Defaults to false.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import porkbun_email_forward.example <domain>/<address>/<forward_to>

terraform import porkbun_email_forward.example example.com/hello/me@example.org