vancluever / terraform-provider-acme

Terraform ACME provider
https://registry.terraform.io/providers/vancluever/acme/latest
Mozilla Public License 2.0
220 stars 74 forks source link

No account exists with the provided key with acme-v02.api.letsencrypt.org/directory prod api #433

Closed neilkuan closed 2 weeks ago

neilkuan commented 2 weeks ago

Use server_url = https://acme-v02.api.letsencrypt.org/directory occurred error.

Terraform provider version

Providers required by configuration:
.
├── provider[registry.terraform.io/vancluever/acme] 2.26.0
├── provider[registry.terraform.io/hashicorp/local]
└── provider[registry.terraform.io/hashicorp/aws]

Providers required by state:

    provider[registry.terraform.io/hashicorp/tls]

    provider[registry.terraform.io/vancluever/acme]

Terraform code

provider "acme" {
  server_url = "https://acme-v02.api.letsencrypt.org/directory"
}

resource "acme_registration" "reg" {
  email_address   = "neil.kuan@xxxx.xxx"
}

resource "acme_certificate" "certificate" {
  account_key_pem             = acme_registration.reg.account_key_pem
  common_name               = "b.internal.tperd.xxxx.xxx"
  subject_alternative_names = ["b.internal.tperd.xxxx.xxx"]
  min_days_remaining = 30

  dns_challenge {
    provider = "route53"
  }
}

Error message:

╷
│ Error: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-acct :: urn:ietf:params:acme:error:accountDoesNotExist :: No account exists with the provided key
│ 
│ 
╵

lego cli success

image

vancluever commented 2 weeks ago

@neilkuan hmm, doesn't look like I can reproduce on this end.

Can you give more context? Is this a new config or are you porting this from an existing one?

Also, make sure you take heed of the warning about switching ACME endpoints in the same configuration WRT registrations that we have here - just in case that applies here.

Thanks!

neilkuan commented 2 weeks ago

I changed the server url from staging to prod , after applied. 🫨🫨🫨

vancluever commented 2 weeks ago

@neilkuan no worries! Glad we got it sorted!