Giter VIP home page Giter VIP logo

Comments (13)

dcordz avatar dcordz commented on September 24, 2024 5

I was able to get this working by "faking" the hashicorp registry in the ~/.terraform.d/plugins directory

Instead of using the target directory/instructions in the readme I did (on my mac):

mkdir -p ~/.terraform.d/plugins/registry.terraform.io/hashicorp/namecheap/1.5.0/darwin_amd64

curl -L https://github.com/adamdecaf/terraform-provider-namecheap/releases/download/1.5.0/terraform-provider-namecheap-osx-amd64 > ~/.terraform.d/plugins/registry.terraform.io/hashicorp/namecheap/1.5.0/darwin_amd64/terraform-provider-namecheap_v1.5.0

chmod +x ~/.terraform.d/plugins/registry.terraform.io/hashicorp/namecheap/1.5.0/darwin_amd64/terraform-provider-namecheap_v1.5.0

Add the provider to terraform in <root_dir>/versions.tf:

terraform {
  required_version = ">= 0.13"
  required_providers {
    namecheap = {
      version  = "~> 1.5.0"
    }
  }
}

Instantiate the provider in <root_dir>/main.tf:

provider "namecheap" {
  username = var.namecheap_username
  api_user = var.namecheap_api_user
  token    = var.namecheap_api_token
  ip       = var.namecheap_ip_address
}

Create the resource:

resource "namecheap_record" "my_record" {
  name    = var.name
  domain  = var.domain
  address = var.address
  type    = var.type
}

from terraform-provider-namecheap.

adamdecaf avatar adamdecaf commented on September 24, 2024 4

I didn't know Terraform 0.13 changes how providers are distributed, but I can see about adding it to the official registry. I doubt I'll get to doing that this week. I don't think the repository needs renamed - terraform-provider-zzzz has been the standard for years.

from terraform-provider-namecheap.

orefalo avatar orefalo commented on September 24, 2024 2

I can confirm the trick worked for me too. It should be added to the instructions.

With that said, I got tired of registering my IP with namecheap for API Access, and switched to the hertzner DNS. the terraform provider works like a charm and it is registered on hashycorp repo.

from terraform-provider-namecheap.

adamdecaf avatar adamdecaf commented on September 24, 2024 1

I'm going to look at updating this provider over the weekend.

from terraform-provider-namecheap.

orefalo avatar orefalo commented on September 24, 2024

https://www.terraform.io/upgrade-guides/0-13.html

look like it's just configuration - testing

from terraform-provider-namecheap.

orefalo avatar orefalo commented on September 24, 2024

ok, so first - it appears this repository must be renamed.
from terraform-provider-namecheap to namecheap

next, you need to register it on https://registry.terraform.io/

from terraform-provider-namecheap.

romanoff avatar romanoff commented on September 24, 2024

There seems to be updated documentation for in-house providers here: https://www.terraform.io/upgrade-guides/0-13.html#in-house-providers . But I wasn't successful in following provided steps. If somebody will be more lucky, please provide your steps. Also would be great if this provided was in general registry so that additional steps were not required to get it working

from terraform-provider-namecheap.

andreyvital avatar andreyvital commented on September 24, 2024

Any updates @adamdecaf? 🤓

from terraform-provider-namecheap.

orefalo avatar orefalo commented on September 24, 2024

As a reference, here is link to another extension I use. They had to publish the extension to get it working with tf 13 -

Please let us know if you want to handle this (I would recommend since you are the author) or if you want someone else to own this deployment type.

banzaicloud/terraform-provider-k8s#6

from terraform-provider-namecheap.

draganm avatar draganm commented on September 24, 2024

@dcordz you can use provider shims: https://numtide.com/articles/generate-terraform-provider-shim/

Unfortunately current version of the shim generator won't work with this repository (expects release files to be either in a .tar.gz or .zip archive), but you can easily create a shim bash script by changing the example from the article a bit and check it in with the rest of the terraform code.

from terraform-provider-namecheap.

kerberjg avatar kerberjg commented on September 24, 2024

@dcordz @draganm These are both good solutions, but they don't seem to work with Terraform Cloud

from terraform-provider-namecheap.

dovidgef avatar dovidgef commented on September 24, 2024

Hi, I was only able to use the namecheap provider using @dcordz trick.
Perhaps add this trick to the Readme instructions.

Thanks for all your hard work.

from terraform-provider-namecheap.

b-m-f avatar b-m-f commented on September 24, 2024

Here is another solution that I have stumbled upon when upgrading to 0.13:

Specify provider

Create versions.tf:

terraform {
  required_providers {
    namecheap = {
      source  = "registry.local/github/namecheap"
      version = "1.5.0"
    }
  }
}

Install module to new local registry folder

Now install the module to ~/.terraform.d/plugins/registry.local/github/namecheap/ with:

Linux

wget -O ~/.terraform.d/plugins/registry.local/github/namecheap/linux_amd64/terraform-provider-namecheap_v1.5.0 https://github.com/adamdecaf/terraform-provider-namecheap/releases/download/1.5.0/terraform-provider-namecheap-linux-amd64

Update state

For the state to use the correct module run:

terraform state replace-provider 'registry.terraform.io/-/namecheap' 'registry.local/github/namecheap'

If you had the hack from @dcordz applied run:

terraform state replace-provider 'registry.terraform.io/hashicorp/namecheap' 'registry.local/github/namecheap'

More info

https://www.terraform.io/upgrade-guides/0-13.html#in-house-providers

from terraform-provider-namecheap.

Related Issues (20)

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.