Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namecheap Provider not using provided API Credentials on initialization in .tf file #75

Open
HubertMajewski opened this issue Sep 15, 2023 · 1 comment

Comments

@HubertMajewski
Copy link

HubertMajewski commented Sep 15, 2023

When setting up the Namecheap Provider, the following options are provided to set the API user and API key: api_user, api_key. Yet, they do not seem to be used in the actual configuration of the provider per this error:

╷
│ Error: error configuring plugin: rpc error: code = Unknown desc = error initializing provider: namecheap: some credentials information are missing: NAMECHEAP_API_USER,NAMECHEAP_API_KEY
│ 
│   with acme_certificate.cert,
│   on main.tf line 107, in resource "acme_certificate" "cert":
│  107: resource "acme_certificate" "cert" {
│ 
╵

Following example config:

provider "namecheap" {
  user_name = "myUser"
  api_user = "myUser"
  api_key = "myKey"
  client_ip = "1.1.1.1"
  use_sandbox = false
}

...

resource "acme_certificate" "cert" {
  account_key_pem          = acme_registration.reg.account_key_pem
  common_name              = "domain.com"
  certificate_p12_password = random_password.cert.result

  dns_challenge {
    provider = "namecheap"
  }
}
@maksym-nazarenko
Copy link

it looks like the acme_certificate resource expects DNS providers to be configured via environment variables, so config {} block is used otherwise:

resource "acme_certificate" "certificate" {
  #...

  dns_challenge {
    provider = "route53"

    config = {
      AWS_ACCESS_KEY_ID     = var.aws_access_key
      AWS_SECRET_ACCESS_KEY = var.aws_secret_key
      AWS_SESSION_TOKEN     = var.aws_security_token
      AWS_DEFAULT_REGION    = "us-east-1"  # OPTIONAL
    }
  }

  #...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants