terraform-provider-rabbitmq icon indicating copy to clipboard operation
terraform-provider-rabbitmq copied to clipboard

DNS issue with OpenVPN connected

Open Sebor opened this issue 3 years ago • 2 comments

OS

MacOS

Terraform Version

1.0.9

Affected Resource(s)

All for provider

Terraform Configuration Files

provider "rabbitmq" {
  endpoint = "https://rabbitmq.test.local"
  username = "user"
  password = data.aws_ssm_parameter.rabbitmq_password.value
}

resource "rabbitmq_user" "monitoring" {
  name     = "monitoring"
  password = "monitoring"
  tags     = ["monitoring"]
}

Expected Behavior

The resource is created

Actual Behavior

Error: Put "https://rabbitmq.test.local/api/users/monitoring": dial tcp: lookup rabbitmq.test.local on 192.168.1.1:53: no such host

Steps to Reproduce

  1. terraform apply

Important Factoids

I use OpenVPN with split dns configuration:

$ scutil --dns
DNS configuration

resolver #1
  search domain[0] : test.local
  nameserver[0] : 192.168.1.1
  if_index : 6 (en0)
  flags    : Request A records
  reach    : 0x00020002 (Reachable,Directly Reachable Address)

resolver #2
  domain   : test.local
  nameserver[0] : 10.250.0.2
  flags    : Supplemental, Request A records
  reach    : 0x00000002 (Reachable)
  order    : 101202

...

DNS configuration (for scoped queries)

resolver #1
  nameserver[0] : 192.168.1.1
  if_index : 6 (en0)
  flags    : Scoped, Request A records
  reach    : 0x00020002 (Reachable,Directly Reachable Address)

Here the "10.250.0.2" is a DNS server behind VPN.

The system resolving works OK:

$ ping rabbitmq.test.local
PING rabbitmq.test.local (10.250.111.111): 56 data bytes

References

The similar issues:

  • https://github.com/hashicorp/terraform-provider-consul/issues/283
  • https://github.com/hashicorp/terraform/issues/3536
  • https://github.com/hashicorp/vault/issues/12012

Sebor avatar Oct 13 '21 20:10 Sebor

This should be fixed now with Go 1.20. See also https://github.com/golang/go/issues/12524 and https://github.com/hashicorp/terraform-provider-vault/pull/1941. It requires this provider to upgrade to Go 1.20 apparently.

Bouke avatar Sep 12 '23 09:09 Bouke

Update available (Go 1.21) into a duplicate provider :

terraform {
  required_providers {
    rabbitmq = {
      source = "rfd59/rabbitmq"
      version = "2.0.0"
    }
  }
}

https://registry.terraform.io/providers/rfd59/rabbitmq/latest/docs

rfavreau avatar May 20 '24 16:05 rfavreau