inwx / terraform-provider-inwx Goto Github PK
View Code? Open in Web Editor NEWINWX Terraform Provider plugin for Terraform
License: MIT License
INWX Terraform Provider plugin for Terraform
License: MIT License
I would like to propse a new resource, that let's you enable the automated DNSSEC management for domains at INWX, as described in the API docs at 2.8.4 and 2.8.5: https://www.inwx.com/en/help/apidoc/f/ch02s08.html
I've had it multiple times that I deleted records in terraform, they appear to be deleted but still exist on INWX. If I add them back in on the side of terraform, it fails because they still exist. So I always need to manually check the records on the website, clean leftovers up so that terraform can work.
That's not how it's supposed to work. If terraform reports a resource as deleted, it should really be deleted.
While setting customer information and several information for domains is possible, there's no way for setting DNS entries for specific domains yet.
I know that there's the Hashicorp DNS module, but unfortunately I couldn't find any information whether INWX supports it or not.
Currently, the provider configuration can only be passed in by specifying it as part of the state. This causes sensitive data to be written to tfstate
.
Many providers can be configured via specific environment variables in order to avoid this problem.
I would like the provider to honor the following environmental variables:
I have changed the nameservers of a domain and then I stopped being able to synchronize that domain. terraform plan
and terraform apply
crash with an error.
In the logs ahead, I'm limiting the refresh to a single resource.
$ terraform plan -parallelism=1 -target=inwx_nameserver_record.voltcyprus_org_cname_beta
inwx_nameserver_record.voltcyprus_org_cname_beta: Refreshing state... [id=voltcyprus.org:571103479]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Warning: Resource targeting is in effect
│
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration.
│
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically suggests to use it as part of an error
│ message.
╵
╷
│ Error: Request cancelled
│
│ with inwx_nameserver_record.voltcyprus_org_cname_beta,
│ on voltcyprus.org.tf line 15, in resource "inwx_nameserver_record" "voltcyprus_org_cname_beta":
│ 15: resource "inwx_nameserver_record" "voltcyprus_org_cname_beta" {
│
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵
Stack trace from the terraform-provider-inwx_v1.3.2 plugin:
panic: interface conversion: interface {} is nil, not []interface {}
goroutine 54 [running]:
github.com/inwx/terraform-provider-inwx/inwx/internal/resource.resourceNameserverRecordRead({0xd38888, 0xc000538de0}, 0xc0003b9680, {0xb92340?, 0xc000606780})
github.com/inwx/terraform-provider-inwx/inwx/internal/resource/resource_nameserver_record.go:263 +0xd54
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0000e0a80, {0xd388c0, 0xc000538480}, 0xd?, {0xb92340, 0xc000606780})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:725 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0000e0a80, {0xd388c0, 0xc000538480}, 0xc0003c0750, {0xb92340, 0xc000606780})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1016 +0x47b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000355d40, {0xd38818?, 0xc00051a9b0?}, 0xc00012ddc0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:613 +0x4a5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0002068c0, {0xd388c0?, 0xc000517bf0?}, 0xc00039a9c0)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:746 +0x43d
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xbf7d00?, 0xc0002068c0}, {0xd388c0, 0xc000517bf0}, 0xc00039a960, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002688c0, {0xd3c2b8, 0xc000205860}, 0xc0003bcea0, 0xc000372240, 0x11d6790, 0x0)
google.golang.org/[email protected]/server.go:1282 +0xcef
google.golang.org/grpc.(*Server).handleStream(0xc0002688c0, {0xd3c2b8, 0xc000205860}, 0xc0003bcea0, 0x0)
google.golang.org/[email protected]/server.go:1619 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:919 +0x28a
Error: The terraform-provider-inwx_v1.3.2 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
If I try to destroy my stack with an dns record I'm getting following error:
Error: Could not delete nameserver record
could not unmarshal rpc response to json: unexpected end of JSON input, {"method":"nameserver.deleteRecord","params":{"id":"xxx"}}, https://api.domrobot.com/jsonrpc/, 200 OK
Is there anything I can do about it?
Hi,
I don't undestand why terraform is always trying to make change. Even if I don't change anything.
This is my code.
terraform {
required_providers {
inwx = {
source = "inwx/inwx"
version = ">= 1.0.0"
}
}
}
provider "inwx" {
api_url = "https://api.domrobot.com/jsonrpc/"
}
resource "inwx_nameserver_record" "a_records" {
domain = "example.com"
name = "www"
type = "A"
content = "12.12.12.12"
ttl = 3600
}
If I run apply and except the changes. It works, and I can see the new entry in the webinterface of INWX.
If I rerun the comand without any changes. Terraform is trying to change something again.
I can rerun it 10 times and it will always detect changes.
Why? Is this a bug?
Hello!
I am getting errors when trying to modify the inwx_nameserver_record
resource that was created by using this plugin. The error implies that the id
parameter that is sent to the INWX API doesn't have the correct type, which should be int
or maybe an array of int
s for some cases.
My versions are
[~/terraform_project] terraform version
Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/inwx/inwx v1.2.0
To reproduce, do the following. We create a CNAME record for hello.domain.com
with value example.org
.
provider "inwx" {
username = "[email protected]"
password = "password"
}
resource "inwx_nameserver_record" "record" {
domain = "domain.com"
type = "CNAME"
name = "hello"
content = "example.org"
}
terraform apply
, verify that the record is created.terraform apply
again.I am getting the following error when destroying the resource:
inwx_nameserver_record.record: Destroying... [id=domain.com:1012250634]
╷
│ Error: Could not delete nameserver record
│
│ API response not status code 1000 pr 1001. Got response:
│ {"code":2005,"msg":"Parameter value syntax error","reason":"The given parameter
│ value for 'id' does not match the expected parameter type
│ 'int'","reasonCode":"The given parameter value for 'id' does not match the
│ expected parameter type 'int'"}
When changing the name
(suggests an in-place update):
inwx_nameserver_record.record: Modifying... [id=domain.com:1012250634]
╷
│ Error: Could not update nameserver record
│
│ with inwx_nameserver_record.record,
│ on main.tf line 792, in resource "inwx_nameserver_record" "record":
│ 792: resource "inwx_nameserver_record" "record" {
│
│ API response not status code 1000. Got response: {"code":2005,"msg":"Parameter
│ value syntax error","reason":"The given parameter value for 'id' does not match
│ the expected parameter type 'array_int'","reasonCode":"The given parameter value
│ for 'id' does not match the expected parameter type 'array_int'"}
When changing the content
, the error message is that same as when changing the name
.
Thank you!
Allow managing DNSSEC. For this setting the DNSKEY etc should be possible
It seems you can't add a domain entry on a nameserver directly with the terraform provider, at least it was only possible for me to add dns entries when I add the domain manually in the web UI first.
The inwx_domain
resource is only useful if the specified domain isn't in use yet and available for registration.
Would it be possible to add a new resource to do this?
This would be especially useful if you e.g. want to create/prepare dns entries before a domain transfer to INWX.
At the moment you need to create the domain manually before being able to use the inwx_nameserver_record
resource at Nameserver > Nameserver entries
It seems the provider does not work, when 2FA is enabled (which seems reasonable at first). The API should support API-Tokens instead.
│ Error: Could not get domain info
│
│ API response not status code 1000. Got response: {"code":2200,"details":[{"code":"ACCOUNT_LOCKED","msg":"You need to unlock your account with your mobile
│ TAN"}],"msg":"Authentication error","reason":"You need to unlock your account with your mobile TAN.","reasonCode":"Error_AccountUnlockRequired"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.