Comments (13)
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.
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.
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.
I'm going to look at updating this provider over the weekend.
from terraform-provider-namecheap.
https://www.terraform.io/upgrade-guides/0-13.html
look like it's just configuration - testing
from terraform-provider-namecheap.
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.
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.
Any updates @adamdecaf? 🤓
from terraform-provider-namecheap.
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.
@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.
@dcordz @draganm These are both good solutions, but they don't seem to work with Terraform Cloud
from terraform-provider-namecheap.
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.
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)
- This provider isn't production ready / this provider has big issues HOT 7
- [ATTENTION] Complete project refactoring HOT 22
- NameCheap Whitelisted IPs HOT 5
- Domain name not found with FreeDNS domain HOT 10
- Allow IPs for Terraform Cloud HOT 10
- Provider 2.0.0+ Import? HOT 4
- OVERWRITE Mode does not warn about removing manual records HOT 1
- Whitelist IPs for known CICD providers HOT 5
- Terraform import record with nameservers incorrectly setting mode to "IMPORT" HOT 2
- Nameserver array missing trailing dot HOT 2
- User not found HOT 1
- FreeDNS subdomain records are all incorrectly going to the root domain HOT 1
- Provider warning for missing api_key, api_user, and user_name even when using NAMECHEAP_* environment variables HOT 1
- Error if CAA 'iodef' record defined HOT 5
- Ability to update the domain contact record information HOT 1
- Namecheap Provider not using provided API Credentials on initialization in .tf file HOT 1
- Feature request: `namecheap_nameserver` resource to register new nameservers HOT 3
- Support for dnssec HOT 5
- Add support for email redirect rules HOT 1
- unable to create sample dns record. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-namecheap.