go-gandi / terraform-provider-gandi

Terraform provider for the Gandi Domain services
Mozilla Public License 2.0
152 stars 45 forks source link

cannot buy new domain with gandi_domain.domain gives 404 #138

Open dzmitry-lahoda opened 1 year ago

dzmitry-lahoda commented 1 year ago
Plan: 1 to add, 0 to change, 0 to destroy.
gandi_domain.domain: Creating...
╷
│ Error: StatusCode: 404 ; Err: 404: The resource could not be found. 

terraform-provider-gandi_v2.2.2

{
  "provider": {
    "gandi": {
      "key": "${var.GANDI_KEY}"
    }
  },
  "resource": {
    "gandi_domain": {
      "domain": {
        "admin": {
          "city": "Funchal",
          "country": "PT",
          "email": "dzmitry@lahoda.pro",
          "family_name": "lahoda",
          "given_name": "dzmtiry",
          "phone": "+351 914 069 170",
          "street_addr": "Rua da Estrela, 1",
          "type": "person",
          "zip": "9000-001"
        },
        "autorenew": true,
        "billing": {
          "city": "Funchal",
          "country": "PT",
          "email": "dzmitry@lahoda.pro",
          "family_name": "lahoda",
          "given_name": "dzmtiry",
          "phone": "+351 914 069 170",
          "street_addr": "Rua da Estrela, 1",
          "type": "person",
          "zip": "9000-001"
        },
        "lifecycle": {
          "prevent_destroy": true
        },
        "name": "composablefi.tech",
        "owner": {
          "city": "Funchal",
          "country": "PT",
          "email": "dzmitry@lahoda.pro",
          "family_name": "lahoda",
          "given_name": "dzmtiry",
          "phone": "+351 914 069 170",
          "street_addr": "Rua da Estrela, 1",
          "type": "person",
          "zip": "9000-001"
        },
        "tech": {
          "city": "Funchal",
          "country": "PT",
          "email": "dzmitry@lahoda.pro",
          "family_name": "lahoda",
          "given_name": "dzmtiry",
          "phone": "+351 914 069 170",
          "street_addr": "Rua da Estrela, 1",
          "type": "person",
          "zip": "9000-001"
        }
      }
    }
  },
  "terraform": {
    "required_providers": {
      "gandi": {
        "source": "go-gandi/gandi"
      }
    }
  },
  "variable": {
    "GANDI_KEY": {
      "type": "string"
    },
    "PROJECT": {
      "description": "Google Cloud Project ID",
      "type": "string"
    }
  }
}
mpereira commented 1 year ago

I'm also seeing this on version 2.2.3:

resource "gandi_domain" "<REDACTED>" {
  name      = "<REDACTED>"
  autorenew = "true"

  owner {
    email       = "<REDACTED>"
    family_name = "<REDACTED>"
    given_name  = "<REDACTED>"
    type        = "<REDACTED>"
    phone       = "<REDACTED>"
    country     = "<REDACTED>"
    city        = "<REDACTED>"
    zip         = "<REDACTED>"
    street_addr = "<REDACTED>"

    data_obfuscated = true
    mail_obfuscated = true
  }
}

terraform apply

│ Error: StatusCode: 404 ; Err: 404: The resource could not be found. 
│ 
│   with gandi_domain.<REDACTED>,
│   on main.tf line 113, in resource "gandi_domain" "<REDACTED>":
│  113: resource "gandi_domain" "<REDACTED>" {
dzmitry-lahoda commented 1 year ago

i used cloud provider i host stuff to buy domain.

nv30 commented 10 months ago

Same here.

matthiasr commented 8 months ago

I ran into this issue as well, but later noticed that the domain does exist in the console. The Creation Date in WHOIS is ~7 minutes after the apply failed. It seems that the provider needs to wait?

dzmitry-lahoda commented 8 months ago

yeah, to have parametrized timeout with big defaults. i guess https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts may work to set it, as long as provider correctly implemeted to handle 404 as retry case