wgebis / terraform-provider-mailgun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Domain Sending Key Support

addshore opened this issue · comments

Hi there,

Terraform Version

1.0.8

Affected Resource(s)

Mailgun

Expected Behaviour

Mailgun allows you to create individual domain targeted api keys.
I would like to be able to create and revoke these for domains that have been created.

Actual Behaviour

This feature is not currently supported.

References

Domain Sending Keys announcement https://www.mailgun.com/blog/mailgun-ip-pools-domain-keys/
Docs https://documentation.mailgun.com/en/latest/api-intro.html?highlight=domain%20sending%20key#authentication

It looks like mailgun api still does not support for creating domain sending keys.

An alternative is to use smtp.

Yep, they do not support Sending API Keys creation via API (just chatted with MailGun support).

They recommend requesting this API via https://feedback.mailgun.com/

For now for our use we will switch to SMTP, but leave this open and also plan on reaching out to the feedback form.
Thanks for the comments.

I'm not sure if this is the same issue but I'm looking to generate a password as push it into the email domain:

resource "random_string" "email-password" {
  length           = 31
  special          = false
}

resource "mailgun_domain" "email-domain" {
  provider = mailgun.api
  name          = var.tenancy
  region        = "us"
  spam_action   = "disabled"
  smtp_password   = random_string.email-password.result
  dkim_key_size   = 1024
}

When ever re-run terraform I get the following error which, to me, indicates that the provider is trying to update the password every time whether it's changed or not:

Error: UnexpectedResponseError URL=https://api.mailgun.net/v3/domains/foobar.com/credentials/postmaster@foobar.com ExpectedOneOf=[]int{200, 202, 204} Got=400 Error: {
│   "message": "New password cannot be the same as old password."
│ }