Giter VIP home page Giter VIP logo

terraform-provider-porkbun's People

Contributors

cullenmcdermott avatar dependabot[bot] avatar parabolala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

terraform-provider-porkbun's Issues

Unable to properly apply repeatedly.

after applying, TF tries to reapply something to do with the ID

I do an apply, then another apply without any changes....

  # porkbun_dns_record.housecarl-cloud will be updated in-place
  ~ resource "porkbun_dns_record" "housecarl-cloud" {
        id      = "342798344"
        # (5 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
╷
│ Warning: Redundant ignore_changes element
│ 
│   on main.tf line 52, in resource "porkbun_dns_record" "housecarl-cloud":
│   52: resource porkbun_dns_record "housecarl-cloud" {
│ 
│ Adding an attribute name to ignore_changes tells Terraform to ignore future changes to the argument in configuration after the object has been created, retaining the
│ value originally configured.
│ 
│ The attribute id is decided by the provider alone and therefore there can be no configured value to compare with. Including this attribute in ignore_changes has no
│ effect. Remove the attribute from ignore_changes to quiet this warning.
╵

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

porkbun_dns_record.housecarl-cloud: Modifying... [id=342798344]
╷
│ Error: Error updating the record
│ 
│   with porkbun_dns_record.housecarl-cloud,
│   on main.tf line 52, in resource "porkbun_dns_record" "housecarl-cloud":
│   52: resource porkbun_dns_record "housecarl-cloud" {
│ 
│ Error status: 400 message: {"status":"ERROR","message":"Edit error: We were unable to edit the DNS record."}
╵

relevant resource:

resource porkbun_dns_record "housecarl-cloud" {
  domain  = "housecarl.cloud"
  type    = "A"
  ttl = "300"
  content = module.housecarl-site.ip_address
  lifecycle {
    ignore_changes = [id]
  }
}

Issues when record_name is empty

Hi,

First, thanks for share this project! EXTREMELY useful for PorkBun users! 👍🏽

I'm facing some issues trying to manage the DNS records when those records applies to the "root" domain (when the parameter "name" is empty). I think these issues could be related with the fact that looks like the PorkBun API gets the name of the records with the domain appended, but I'm not sure.

The steps to reproduce the issue in my case are:

  • Create a DNS record with an empty name (success):
Terraform will perform the following actions:

  # porkbun_dns_record.records will be created
  + resource "porkbun_dns_record" "records" {
      + content = "test.com"
      + domain  = "mydomain.com"
      + id      = (known after apply)
      + ttl     = "600"
      + type    = "ALIAS"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: .terraform/terraform.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply ".terraform/terraform.tfplan"
Terraform plan built successfully!

Applying Terraform plan:
porkbun_dns_record.records: Creating...
porkbun_dns_record.records: Creation complete after 2s [id=281421583]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Creation was OK, and I can see the DNS record successfully in the PorkBun dashboard... but if I just re-execute the code again (with NO changes at all, just re-run the Terraform code again) it's not idempotent... the execution fails:

Terraform will perform the following actions:

  # porkbun_dns_record.records will be updated in-place
  ~ resource "porkbun_dns_record" "records" {
      ~ id      = "281421583" -> (known after apply)
      - name    = "mydomain.com" -> null
        # (4 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: .terraform/terraform.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply ".terraform/terraform.tfplan"
Terraform plan built successfully!

Applying Terraform plan:
porkbun_dns_record.records: Modifying... [id=281421583]
╷
│ Error: Error updating the record
│ 
│   with porkbun_dns_record.records,
│   on domains.tf line 18, in resource "porkbun_dns_record" "records":
│   18: resource "porkbun_dns_record" "records" {
│ 
│ Error 400: {"status":"ERROR","message":"Edit error: We were unable to edit
│ the DNS record."}
╵

Looks like the "name" parameter retrieved from the PorkBun API has the domain attached, and this new execution try to modify it because the configured "name" in my code is still empty... and it fails.

Thanks in advance,

Issues due poor requests limits in Porkbun API

Hi,

I think the Porkbun API has very low limits about the requests/time and paralell requests.
If you use this provider to manage just a few DNS records, everything looks good... but if you are trying to handle bigger configurations, there are a lot of random issues during the Terraform plan/apply.

I disabled the Terraform paralelism (with terraform plan -parallelism=1) and certainly it was better... but after adding a few more domains (nothing huge, just 5 or 6 domains with 6 or 7 DNS records each) the plan/apply is not able to work again.

So I'm pretty sure that there are some very low limits in the Porkbun API about concurrent request and request/min, at least.

There is no documentation at all in Porkbun website. I wrote to their support asking about that, but I have no response yet.

I was checking some other providers, and lot of them implements retries mechanism to avoid these kind of errors, so looks like the best solution to avoid error...

I wish I could send a PR with that implementation, but I'm not familiar with Go at all...

Regards,

Error: Resource type not found on 0.2.4

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"
        }
      }
    }

DNS Record Creation is hanging

Thanks for developing this provider plugin!

The issue

When I attempt to generate an NS record using the provider, it appears to perpetually hang (alt-tabbing to my terminal, the current attempt to create 4 records is up to Still creating... [8m50s elapsed]

Use case

I'm creating a hosted zone in AWS for a subdomain on an externally-hosted DNS provider, and then attempting to create NS records in Porkbun.

Example Terraform config

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

provider "porkbun" {
  api_key = var.porkbun_api_key
  secret_key = var.porkbun_secret_key
}

locals {
  top_level_domain = "example.info" #Replaced with placeholder
  subdomain = "testing" # Replaced with placeholder
  domain_name = "testing.example.info"
}



resource "porkbun_dns_record" "ns_records" {
  domain = local.top_level_domain
  name        = local.subdomain
  type        = "NS"
  content       = "ns-1566.awsdns-03.co.uk"
  notes = "Test case!"
}


variable "porkbun_api_key" {
  description = "The API key for your Porkbun account"
}

variable "porkbun_secret_key" {
  description = "The SECRET key for your Porkbun account"
}

This results in the following plan:

Terraform will perform the following actions:

  # porkbun_dns_record.ns_records will be created
  + resource "porkbun_dns_record" "ns_records" {
      + content = "ns-1566.awsdns-03.co.uk"
      + domain  = "example.info"
      + id      = (known after apply)
      + name    = "testing"
      + notes   = "Test case!"
      + type    = "NS"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Expected Result

The NS record is created in <30 seconds

Actual Result

When the plan is applyed, the logs are as follows:

porkbun_dns_record.ns_records: Creating...
porkbun_dns_record.ns_records: Still creating... [10s elapsed]
porkbun_dns_record.ns_records: Still creating... [20s elapsed]
porkbun_dns_record.ns_records: Still creating... [30s elapsed]
porkbun_dns_record.ns_records: Still creating... [40s elapsed]
porkbun_dns_record.ns_records: Still creating... [50s elapsed]
porkbun_dns_record.ns_records: Still creating... [1m0s elapsed]
[snip]
porkbun_dns_record.ns_records: Still creating... [4m30s elapsed]
porkbun_dns_record.ns_records: Still creating... [4m40s elapsed]

Interestingly, using the ctrl+c interrupt at this point raises the message Please wait for Terraform to exit or data loss may occur. Gracefully shutting down.. but the Still creating... logs continue to be printed.

API auth error in versions 0.2.2 and 0.2.3

I recently encountered a problem after updating from version 0.2.1 to 0.2.2 and 0.2.3. In these newer versions, I get an API auth error with the message Error: status: 400 message: {"status":"ERROR","message":"Invalid API key. (001)"}, even though the access and secret key remain unchanged. Unfortunately, I haven't yet had time to delve into the exact code behind this issue. Am I missing something obvious?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.