Code Monkey home page Code Monkey logo

terraform-provider-inwx's People

Contributors

costasd avatar ddmler avatar dzegarra avatar fsoederhuyzen avatar hollow avatar lkubb avatar nickufer avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

terraform-provider-inwx's Issues

Bug: Nameserver records are sometimes deleted in terraform state but still exist on INWX

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.

Feature request: support setting DNS entries

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.

Feature request: Read configuration from environment

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:

  • INWX_USERNAME
  • INWX_PASSWORD
  • INWX_TAN
  • INWX_API_URL

Plugin crash when trying to refresh a refresh a inwx_nameserver_record that does not exist

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.

Deletion fails

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?

Terraform Always Plans Changes for Unmodified INWX Record"

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?

Wrong type for `id` when modifying or destroying a `nameserver_record` resource

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 ints 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.

  1. Have a configuration similar to this:
provider "inwx" {
  username = "[email protected]"
  password = "password"
}

resource "inwx_nameserver_record" "record" {
  domain  = "domain.com"
  type    = "CNAME"
  name    = "hello"
  content = "example.org"
}
  1. Run terraform apply, verify that the record is created.
  2. Modify the record resource or remove it from configuration, run 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!

Feature request: Create domain on nameserver

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

ACCOUNT_LOCKED when 2FA is enabled

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

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.