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

Error: Resource type not found on 0.2.4 #53

Closed
tommyalatalo opened this issue Oct 8, 2023 · 9 comments
Closed

Error: Resource type not found on 0.2.4 #53

tommyalatalo opened this issue Oct 8, 2023 · 9 comments

Comments

@tommyalatalo
Copy link

When running 0.2.4 I get the below errors. Has something broken with the last release?
I'm not seeing any changes to the documentation indicating that the resource names have changed.

If I revert to 0.2.3 then the resources are updated from the API, but then I get "Invalid API key" errors then the plan is created.

│ Error: Resource Type Not Found
│
│   with porkbun_dns_record.wildcard,
│   on dns.tf line 1, in resource "porkbun_dns_record" "wildcard":
│    1: resource "porkbun_dns_record" "wildcard" {
│
│ No resource type named "porkbun_dns_record" was found in the provider.

I'm configuring the provider like this:

    provider "porkbun" {
      api_key = data.vault_generic_secret.terraform.data["porkbun_api_key"]
      secret_key = data.vault_generic_secret.terraform.data["porkbun_secret_key"]
    }

    terraform {
      required_providers {
        porkbun = {
          source = "cullenmcdermott/porkbun"
          version = "0.2.4"
        }
      }
    }
@cullenmcdermott
Copy link
Owner

Hi! Nothing should have broken in the last release, I’ve been using it and my testing still passes. Can you please share an example of your resource configuration that is causing this as well?

@tommyalatalo
Copy link
Author

They're all in this form, redacted domain for privacy:

resource "porkbun_dns_record" "example_com_alias" {
  domain  = "example.com"
  name    = ""
  type    = "ALIAS"
  content = "example.gitlab.io"
}

@cullenmcdermott
Copy link
Owner

So far I'm unable to replicate this. What I've tried so far is a configuration like this:

// Keys are set via environment variables
provider "porkbun" {}

terraform {
  required_providers {
    porkbun = {
      source = "cullenmcdermott/porkbun"
      version = "0.2.4"
    }
  }
}

variable "domain" {}

resource "porkbun_dns_record" "example_com_alias" {
  domain  = var.domain
  name    = ""
  type    = "ALIAS"
  content = "example.gitlab.io"
}

I also tried this from an existing as well as a fresh workspace and it all worked fine.

Could you try the following for me? Delete your .terraform directory and run a new terraform init -upgrade? Sometimes that can fix weird terraform issues. If that doesn't help can you set TF_LOG=trace and send me the output of terraform init -upgrade && terraform plan?

@tommyalatalo
Copy link
Author

I've tried removing the terraform cache several times, it doesn't help unfortunately.
I'm using Terraform 1.6.1 and Terragrunt on the latest version, not that Terragrunt really should affect this, it's just a wrapper. Here is the trace output from the init and plan: https://hastebin.com/share/fikacemazu.java

@cullenmcdermott
Copy link
Owner

Hi! I was able to replicate this by upgrading to TF 1.6.1. Thank you for mentioning that. I'll. dig into this more as soon as I can.

@tommyalatalo
Copy link
Author

Any updates on this? Not that this is urgent but I'm in an unfortunate situation where I can't downgrade to make this work again, so I'm currently blocked from updating my DNS with Terraform :|

@JakeMittleman
Copy link

I would also love an update on this :)

@cullenmcdermott
Copy link
Owner

This is related to hashicorp/terraform-plugin-framework#853

@tommyalatalo
Copy link
Author

Thanks for fixing this!

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

3 participants