Giter Club home page Giter Club logo

terraform-provider-dnsimple's Introduction

DNSimple Terraform Provider

Requirements

  • Terraform 1.0.3 or greater
    • Old versions may be supported, but Terraform does not support automatically fetching protocol v6 providers from the registry prior to Terraform 1.0.3 as mentioned here.
  • Go 1.18+ (to build the provider plugin)

Building The Provider

Clone repository to: $GOPATH/src/github.com/dnsimple/terraform-provider-dnsimple

$ mkdir -p $GOPATH/src/github.com/dnsimple; cd $GOPATH/src/github.com/dnsimple
$ git clone https://github.com/dnsimple/terraform-provider-dnsimple.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/dnsimple/terraform-provider-dnsimple
$ make build

Using the provider

See the DNSimple Provider documentation to get started using the DNSimple provider.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.18+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-dnsimple
...

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

$ make testacc

terraform-provider-dnsimple's People

Contributors

ags4no avatar appilon avatar case-fastly avatar dependabot[bot] avatar dwradcliffe avatar dxtimer avatar ecomba avatar gcox avatar gechr avatar girishramnani avatar goloroden avatar grubernaut avatar issyl0 avatar jamesbelchamber avatar jefferai avatar justincampbell avatar katbyte avatar mitchellh avatar nestorsalceda avatar olemchls avatar paultyng avatar pearkes avatar radeksimko avatar sbastn avatar sethvargo avatar stack72 avatar tombuildsstuff avatar visitjonathan avatar weppos avatar yob avatar

Stargazers

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

Watchers

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

terraform-provider-dnsimple's Issues

dnsimple_domain_delegation name_servers should be a set, not a list

Terraform Version

v1.5.7

Affected Resource(s)

  • dnsimple_domain_delegation

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "dnsimple_domain" "my_domain" {
  name = "dnsimple.com"
}

resource "google_dns_managed_zone" "my_domain" {
  name        = "my-domain"
  dns_name    = "dnsimple.com."
}

resource "dnsimple_domain_delegation" "my_domain" {
  domain       = dnsimple_domain.my_domain.name
  name_servers = google_dns_managed_zone.my_domain.name_servers
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Expected Behavior

After applying, if the name_servers don't change, there shouldn't be a diff in the plan.

Actual Behavior

I get a permanent diff:

  # dnsimple_domain_delegation.my_domain must be replaced
-/+ resource "dnsimple_domain_delegation" "my_domain" {
      ~ id           = "dnsimple.com" -> (known after apply)
      ~ name_servers = [ # forces replacement
          - "ns-cloud-a4.googledomains.com",
            "ns-cloud-a1.googledomains.com",
            # (1 unchanged element hidden)
            "ns-cloud-a3.googledomains.com",
          + "ns-cloud-a4.googledomains.com",
        ]
        # (1 unchanged attribute hidden)
    }

Steps to Reproduce

  1. terraform apply
  2. terraform plan

Important Factoids

This doesn't seem to happen on every domain, even with the same name servers.

It appears that DNSimple's API treats the list of name servers as unordered, and even after apply is returning them in the original state. I've verified this by manually editing them through the DNSimple console.

If the DNSimple API treats these items as unordered, then a set would be a more appropriate type than a list here, as the list treats changes in order as significant, while the set does not.

incompatible with 0.12

Error: Failed to instantiate provider "dnsimple" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]

terraform -v
Terraform v0.12.0

  • provider.dnsimple v0.1.0

Option to Delete Existing Records Before Adding

This issue was originally opened by @thegranddesign as hashicorp/terraform#5892. It was migrated here as part of the provider split. The original body of the issue is below.


Often when rerunning my applies, Terraform can't figure out that the DNSimple A record is supposed to be updated instead of created. This happens on CNAME (which error out) and A records (which don't). However since multiple A records can be added for a domain, it associates the domain with multiple IPs (which I don't want).

So I'd love some way (maybe an option?) to say "Hey if you see a record for this hostname, delete it before you add it."

Ignore DNSIMPLE_EMAIL if DNSIMPLE_ACCOUNT and DNSIMPLE_TOKEN are passed

Although DNSIMPLE_ACCOUNT and DNSIMPLE_TOKEN contain v2 credentials, Terraform still thinks I'm providing it with v1 credentials merely by the fact I also supplied DNSIMPLE_EMAIL.

Error: Error running plan: 1 error(s) occurred:

* provider.dnsimple: DNSimple API v2 requires an account identifier and the new OAuth token. Please upgrade your configuration.

The code that validates environment variables looks like this pseudocode:

token = ENV['DNSIMPLE_TOKEN']
account = ENV['DNSIMPLE_ACCOUNT']

if ENV['DNSIMPLE_EMAIL']
  raise 'DNSimple API v2 requires an account identifier and the new OAuth token. Please upgrade your configuration.' 
end

This is wrong - it should only complain about v1 credential if no v2 credentials are provided:

token = ENV['DNSIMPLE_TOKEN']
account = ENV['DNSIMPLE_ACCOUNT']

if not token or not account
  if ENV['DNSIMPLE_EMAIL']
    raise 'DNSimple API v2 requires an account identifier and the new OAuth token. Please upgrade your configuration.' 
  end
end

Technically, this error message DNSimple API v2 requires an account identifier and the new OAuth token. Please upgrade your configuration. is wrong because I did pass API v2 credentials. A fact that I also passed v1 credentials via DNSIMPLE_EMAIL variable should not bother Terraform. I provided the two required variables as per the reference, right? Any other variables should be ignored because it's none of provider's business what I have in my environment, is it DNSIMPLE_EMAIL or HELLO_WORLD. ๐Ÿ˜ธ

Terraform Version

Terraform v0.11.7
+ provider.dnsimple v0.1.0

v0.17.0 not compatible with Terraform 1.0.0

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

1.0.0

Affected Resource(s)

All

Expected Behavior

What should have happened?

New provider version should work in Terraform versions claimed to be supported by the docs.

Actual Behavior

What actually happened?

22:09:43   Info     |       โ”‚ Error: Incompatible provider version
22:09:43   Info     |       โ”‚
22:09:43   Info     |       โ”‚ Provider "dnsimple/dnsimple" v0.17.0 is not compatible with Terraform
22:09:43   Info     |       โ”‚ 1.0.0.
22:09:43   Info     |       โ”‚ You need to downgrade to v0.16.3 or earlier. Select it with the following
22:09:43   Info     |       โ”‚ constraint:
22:09:43   Info     |       โ”‚ 	version = "0.16.3"
22:09:43   Info     |       โ”‚
22:09:43   Info     |       โ”‚ Terraform checked all of the plugin versions matching the given constraint:
22:09:43   Info     |       โ”‚
22:09:43   Info     |       โ”‚
22:09:43   Info     |       โ”‚ Consult the documentation for this provider for more information on
22:09:43   Info     |       โ”‚ compatibility between provider and Terraform versions.
22:09:43   Info     |       โ”‚ Alternatively, upgrade to the latest version of Terraform for compatibility
22:09:43   Info     |       โ”‚ with newer provider releases.
22:09:43   Info     |       โ”‚

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform init

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

#93 seems relevant here.

dnsimple_lets_encrypt_certificate defaults now to ECDSA signature algorithm, but RSA should be used for ESX

Hi there,

I need to able to order RSA type private keys for dnsimple_lets_encrypt_certificate. The API https://developer.dnsimple.com/v2/certificates/#issueRenewalLetsencryptCertificate states that is possible.

How can I either set the default to RSA or configure the Ressource to use RSA?

Terraform Version

โฏ terraform -v
Terraform v1.3.7
on darwin_arm64

Affected Resource(s)

Please list the resources as a list, for example:

  • dnsimple_lets_encrypt_certificate

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "dnsimple_lets_encrypt_certificate" "esx-1-dc1-cert" {
  domain_id  = "xzy"
  contact_id = var.dnsimple_contact_id
  auto_renew = true
  name       = dnsimple_zone_record.esx-1-dc1.name
}

Expected Behavior

creates a RSA private key

Actual Behavior

creates a ECDSA private key.

Important Factoids

the default changed and breaker the deployment

References

By default, a certificate uses ECDSA signature algorithm, but RSA can be used as well if your specific scenario required it.

Introduce prefetch to avoid multiple calls to the API

Some of our (larger) customers using terraform to manage a large set of zones have reported problems with getting to the limits of the API calls they are allowed to make (due to how terraform works and the call limits set in the API). This has been solved by setting different configurations in different directories and avoiding the API limits.

This is not ideal and we thought about the following.

We will introduce a new configuration variable prefetch. When prefetch is set to true the terraform provider will prefetch all the zone records of a given zone and store them in a local store to be used with the different operations (specifically when reading a zone record). This will reduce the calls to the API and therefore making the provider usable (without running into the API call limits) for larger configurations.

Record cannot be imported

Terraform Version

v1.4.6

Affected Resource(s)

  • dnsimple_zone_record

Terraform Configuration Files

resource "dnsimple_zone_record" "netlify_aliases_txt" {
  for_each  = local.netlify_dns["aliases"]
  zone_name = each.key
  name      = ""
  type      = "TXT"
  value     = "ALIAS for ${each.value}"
  ttl       = 60
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

โžœ  dns git:(dns-changes) โœ— terraform import 'dnsimple_zone_record.netlify_aliases_txt["some_domain"]' "some_domain_44041155"
โ•ท
โ”‚ Error: The provider returned a resource missing an identifier during ImportResourceState. This is generally a bug in the resource implementation for import. Resource import code should not call d.SetId("") or create an empty ResourceData. If the resource is missing, instead return an error. Please report this to the provider developers.

after creating vm usinng terraform we want to join the vm in domin it's not working resource

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Affected Resource(s)

Please list the resources as a list, for example:

  • opc_instance
  • opc_storage_volume

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

Actual Behavior

What actually happened?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234

Support SSL Certificates

DNSimple allow you to get the certificate, chain and private key for an SSL Cert purchased from them. It would be useful to support this resource so we can use it as a data provider, using the attributes to provide to other resources.

nil entry in ImportState results

Terraform Version

0.12.6

Affected Resource(s)

  • dnsimple_record

Terraform Configuration Files

provider "dnsimple" {
  version = "~> 0.2.0"
}

resource "dnsimple_record" "www_mycompany_com" {
  domain    = "www.mycompany.com"
  name      = "www.mycompany.com"
  ttl       = 60
  type      = "CNAME"
  value     = "www.origins.mycompany.com"
}

Expected Behavior

terraform import dnsimple_record.www_mycompany_com www.mycompany.com_123456789 should import the domain.

Actual Behavior

What actually happened?

dnsimple_record.www_mycompany_com: Importing from ID "www.mycompany.com_123456789"...

Error: nil entry in ImportState results. This is always a bug with
the resource that is being imported. Please report this as
a bug to Terraform.

Steps to Reproduce

  1. export DNSIMPLE_ACCOUNT=1234
  2. export DNSIMPLE_TOKEN=abcde12345ABCDE
  3. create a DNS record in DNSimple
  4. get the ID of the record
  5. write a matching dnsimple_record resource
  6. run terraform import dnsimple_record.my_record my.domain_12345

Important Factoids

I'm using a user token, not an account token. We're on the "Silver" plan, which doesn't allow multiple users.

When I run

curl -H 'Authorization: Bearer abcde12345ABCDE' https://api.dnsimple.com/v2/whoami

I get back

{
  "data": {
    "user": {
      "id": 9876,
      "email": "[email protected]",
      "created_at":"2012-07-20T08:16:56Z",
      "updated_at":"2019-08-02T16:24:28Z"
    },
    "account":null
  }
}

I'm not 100% sure that I have the right thing set for DNSIMPLE_ACCOUNT. I've tried:

  • the 12345 from the URL in https://dnsimple.com/a/12345/account when I click on "Account" in the UI
  • the 9876 from the response to GET https://api.dnsimple.com/v2/whoami
  • the string "MyCompany"

Terraform DNSimple Prefetch Panic

As suggested, this is a separate ticket for the panic issue when using the prefetch option enabled. A similar issue with the previous one I have created #57

Lets me know if a log file is needed, because I believe that was already noted in the previous ticket.

DNSimple module panic

Panic Output

Screenshot 2022-09-13 at 04 49 27

Anyone knows what I am dealing with here? With same code, I can deploy to another domain (zone name)
It appears to me that it might be a possibility that I added too many subdomain within certain period of time which I am getting blocked. Can someone confirm this?

Terraform Plugin SDK v1 End of Life

We use a deprecated version of the Plugin that will be EOL soon:

The Terraform Plugin SDK is a framework that lets developers create and maintain Terraform providers. HashiCorp will be ending support for the version 1 release of the Plugin SDK on July 31, 2021. Users of the Terraform CLI and Terraform Cloud are not affected by this and do not need to take any action. Maintainers of Terraform providers who are impacted are encouraged to use our upgrade guide to move to version 2 of the Terraform Plugin SDK. Follow our tutorials to develop your first provider. Additional information can be found in the Terraform Provider Developer Community Discuss forum: End of Life Timeline for v1 of the Terraform Plugin SDK.

dnsimple_lets_encrypt_certificate resource: docs updates needed

The current docs show the following:

The following argument(s) are supported:

domain_id - (Required) The domain to be issued the certificate for
contact_id - (Deprecated) The contact id for the certificate

But terraform plan is saying that a name = argument is required. auto_renew is also missing from the Argument Reference list.

It looks like the docs for this resource could use some updating?

[Question] Using AWS ACM with DNS validation

I am trying to create multiple AWS certificates, but when I tried to create zone records it ended up with

โ”‚ A matching record already exists for this zone, Another record already exists
โ”‚ for _12ee1d57338f45a0e6ef43cxxx.example.com, cannot add a CNAME, A
โ”‚ CNAME record exists for _12ee1d57338f45a0e6ef43xxx.example.com,
โ”‚ cannot add another record

Any way to perform the update in place?

resource "dnsimple_zone_record" "dnsrecord" {
   for_each = {
    for dvo in aws_acm_certificate.certificate.domain_validation_options : dvo.domain_name => {
      record_name   = dvo.resource_record_name
      record_value = dvo.resource_record_value
      type   = dvo.resource_record_type
      domain_name = dvo.domain_name
    }
  }
  zone_name = var.dnsimple_domain
  name   = each.value.record_name
  value  = each.value.record_value
  type   = each.value.type
  ttl    = 3600
}

resource "aws_acm_certificate" "certificate" {
  domain_name               = var.domain_name
  validation_method         = "DNS"
  subject_alternative_names = var.hosts
  tags = {
    Environment = var.environment
    Terraform   = "true"
  }
}

Originally posted by @adiii717 in #25 (comment)

Wildcard DNS record

Terraform Version

0.12.10

Affected Resource(s)

  • dnsimple_record

Terraform Configuration Files

resource "dnsimple_record" "redirect_0_wildcard" {
  domain = "*.xxx.com"
  name = ""
  type = "A"
  value = "1.1.1.1"
  ttl = 600
}

Debug Output

Failed to create DNSimple Record: POST https://api.dnsimple.com/v2/XXXX/zones/*.domain.com/records: 404 Zone *.domain.com not foun

Expected Behavior

The wildcard should be placed.

Actual Behavior

404 - zone not found

Steps to Reproduce

  1. terraform apply

Rename resource_dnsimple_record to resource_zone_record

The current resource resource_dnsimple_record uses deprecated names that are not reflected in our current API ZoneRecord.

  • Rename resource_dnsimple_record to resource_dnsimple_zone_record
  • Rename fields:
    • domain -> zone_name
    • hostname -> qualified_name
    • domain_id -> zone_id
  • Return zone_name if possible.

dnsimple_zone_record Error: API returned a Validation Error for: value

First thanks for maintaining a terraform provider to the dnsimple service. We have been using it for over a year. We did recently upgrade from 0.11.1 to 1.3.0 but have not run into any issues until today.

We use the dnsimple provider to add the necessary txt records to our dns server in our CI/CD pipeline.

Today we received the following error when trying to apply our configuration to a new workspace (every PR creates a new terraform workspace).

Error: API returned a Validation Error for: value
Txt must be wrapped between double-quotes ("")

The thing is nothing has changed with the configuration and the value is wrapped in double quotes.

resource "dnsimple_zone_record" "outbound_messaging_spf_record" {
  zone_name = var.domain
  name      = var.messaging_host
  value     = "v=spf1 include:spf.mandrillapp.com ?all"
  type      = "TXT"
  ttl       = 3600
}

Terraform Version

Terraform v1.6.2
on linux_amd64

  • provider registry.terraform.io/dnsimple/dnsimple v1.3.0
  • provider registry.terraform.io/hashicorp/google v5.2.0

Affected Resource(s)

  • dnsimple_zone_record

Terraform Configuration Files

resource "dnsimple_zone_record" "outbound_messaging_spf_record" {
  zone_name = var.domain
  name      = var.messaging_host
  value     = "v=spf1 include:spf.mandrillapp.com ?all"
  type      = "TXT"
  ttl       = 3600
}

Debug Output

Error: API returned a Validation Error for: value
 
   with dnsimple_zone_record.outbound_messaging_spf_record,
   on main.tf line 320, in resource "dnsimple_zone_record" "outbound_messaging_spf_record":
   320:   value     = "v=spf1 include:spf.mandrillapp.com ?all"
 
Txt must be wrapped between double-quotes ("")

Expected Behavior

Terraform should apply all changes and the txt record should be created

Actual Behavior

Terraform exits on apply and the txt record is not created.

Steps to Reproduce

  1. terraform apply

Turning prefetch on changes the view of the world in DNSimple

Terraform Version

Terraform v1.3.6
on darwin_arm64
+ provider registry.terraform.io/dnsimple/dnsimple v0.15.0

Affected Resource(s)

  • dnsimple_zone_record

Terraform Configuration Files

main.tf

terraform {
  required_providers {
    dnsimple = {
      source  = "dnsimple/dnsimple"
      version = "0.15.0"
    }
  }

  required_version = ">= 1.1.0"

  backend "remote" {
    organization = "example"

    workspaces {
      prefix = "example-"
    }
  }
}

provider "dnsimple" {
  token    = var.DNSIMPLE_TOKEN
  account  = var.DNSIMPLE_ACCOUNT
  sandbox  = var.DNSIMPLE_SANDBOX_ENVIRONMENT
  prefetch = var.DNSIMPLE_PREFETCH
}

locals {
  domain1_com      = "domain1.com"
  domain1_com_json = jsondecode(file("${path.root}/${local.domain1_com}.json"))
  domain1_com_set = flatten([for each in local.domain1_com_json :
    {
      "id"       = base64encode("${each.value}-${each.type}-${each.name}")
      "name"     = each.name
      "value"    = each.value
      "type"     = each.type
      "ttl"      = each.ttl
      "priority" = can(each.priority) ? each.priority : null
  }])
}

resource "dnsimple_zone_record" "domain1_com" {
  for_each = {
    for each in local.domain1_com_set : each.id => each
  }
  zone_name = local.domain1_com
  name      = each.value.name
  value     = each.value.value
  type      = each.value.type
  ttl       = each.value.ttl
  priority  = each.value.priority
}

variable "DNSIMPLE_TOKEN" {
  description = "DNsimple api token"
}

variable "DNSIMPLE_ACCOUNT" {
  description = "DNsimple account ID"
}

variable "DNSIMPLE_SANDBOX_ENVIRONMENT" {
  description = "true/false to specify if this is using sandbox"
}

variable "DNSIMPLE_PREFETCH" {
  description = "true/false to specify if this should save api requests to avoid rate-limiting"
}

domain1.com.json

[
  {
    "name": "",
    "value": "1.1.1.1",
    "type": "A",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "1a",
    "value": "1.1.1.1",
    "type": "A",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "2a",
    "value": "1.1.1.1",
    "type": "A",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "3a",
    "value": "1.1.1.1",
    "type": "A",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "1cname",
    "value": "www.example.com",
    "type": "CNAME",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "2cname",
    "value": "www.example.com",
    "type": "CNAME",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "3cname",
    "value": "www.example.com",
    "type": "CNAME",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "",
    "value": "https://www.example.com",
    "type": "URL",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "",
    "value": "mail.example.com",
    "type": "MX",
    "zone": "domain1.com",
    "ttl": 3600,
    "priority": 11
  },
  {
    "name": "1mx",
    "value": "mail.example.com",
    "type": "MX",
    "zone": "domain1.com",
    "ttl": 3600,
    "priority": 10
  },
  {
    "name": "2mx",
    "value": "mail25.example.com",
    "type": "MX",
    "zone": "domain1.com",
    "ttl": 3600,
    "priority": 5
  },
  {
    "name": "2mx",
    "value": "mail21.example.com",
    "type": "MX",
    "zone": "domain1.com",
    "ttl": 3600,
    "priority": 1
  },
  {
    "name": "example",
    "value": "ns-1.example.com",
    "type": "NS",
    "zone": "domain1.com",
    "ttl": 3600
  },
  {
    "name": "example",
    "value": "ns-2.example.com",
    "type": "NS",
    "zone": "domain1.com",
    "ttl": 3600
  },
  {
    "name": "example",
    "value": "ns-3.example.com",
    "type": "NS",
    "zone": "domain1.com",
    "ttl": 3600
  },
  {
    "name": "example",
    "value": "ns-4.example.com",
    "type": "NS",
    "zone": "domain1.com",
    "ttl": 3600
  },
  {
    "name": "_example",
    "value": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeee=",
    "type": "TXT",
    "zone": "domain1.com",
    "ttl": 600
  },
  {
    "name": "_example.e",
    "value": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeey",
    "type": "TXT",
    "zone": "domain1.com",
    "ttl": 600
  }
]

Debug Output

https://gist.github.com/lawrencewilson/c74945564685cb46241718a2db56a5b9

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

When you enable prefetch without changing the state, we should see No changes in terraform.

Actual Behavior

When you enable prefetch without changing the state, terraform detects drift where there is none and will attempt to delete and re-create records.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Set the values as necessary (Ensure the prefetch is set to false):
$Env:TF_VAR_DNSIMPLE_TOKEN="secretvalue"
$Env:TF_VAR_DNSIMPLE_SANDBOX_ENVIRONMENT="true"
$Env:TF_VAR_DNSIMPLE_ACCOUNT="0000"
$Env:TF_WORKSPACE="localdev"
$Env:TF_VAR_DNSIMPLE_PREFETCH="false"
  1. Initialise the back end and apply the configuration
terraform init
terraform apply
  1. run terraform plan to ensure no state changes
terraform plan                                               
[WARN] Invalid log level: "TRUE". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR OFF][WARN] Invalid log level: "TRUE". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR 

... redacted to save space ...

dnsimple_zone_record.domain1_com["bWFpbC5leGFtcGxlLmNvbS1NWC0xbXg="]: Refreshing state... [id=2940594]
dnsimple_zone_record.domain1_com["aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20tVVJMLQ=="]: Refreshing state... [id=2940578]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
  1. set the prefetch to true and re-initialize
PS > $Env:TF_VAR_DNSIMPLE_PREFETCH="true" 
PS > terraform init

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of dnsimple/dnsimple from the dependency lock file
- Using previously-installed dnsimple/dnsimple v0.15.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
  1. run another plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # dnsimple_zone_record.domain1_com["MS4xLjEuMS1BLQ=="] must be replaced
-/+ resource "dnsimple_zone_record" "domain1_com" {
      ~ id             = "2940587" -> (known after apply)
      ~ priority       = "0" -> (known after apply)
      ~ qualified_name = "domain1.com" -> (known after apply)
      ~ ttl            = "3600" -> "600"
      ~ type           = "SOA" -> "A" # forces replacement
      ~ value          = "ns1.dnsimple.com admin.dnsimple.com 1677551382 86400 7200 604800 300" -> "1.1.1.1"
      ~ zone_id        = "domain1.com" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

  # dnsimple_zone_record.domain1_com["aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20tVVJMLQ=="] must be replaced
-/+ resource "dnsimple_zone_record" "domain1_com" {
      ~ id             = "2940578" -> (known after apply)
      ~ priority       = "0" -> (known after apply)
      ~ qualified_name = "domain1.com" -> (known after apply)
      ~ ttl            = "3600" -> "600"
      ~ type           = "SOA" -> "URL" # forces replacement
      ~ value          = "ns1.dnsimple.com admin.dnsimple.com 1677551382 86400 7200 604800 300" -> "https://www.example.com"
      ~ zone_id        = "domain1.com" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

  # dnsimple_zone_record.domain1_com["bWFpbC5leGFtcGxlLmNvbS1NWC0="] must be replaced
-/+ resource "dnsimple_zone_record" "domain1_com" {
      ~ id             = "2940580" -> (known after apply)
      ~ priority       = "0" -> "11"
      ~ qualified_name = "domain1.com" -> (known after apply)
      ~ type           = "SOA" -> "MX" # forces replacement
      ~ value          = "ns1.dnsimple.com admin.dnsimple.com 1677551382 86400 7200 604800 300" -> "mail.example.com"
      ~ zone_id        = "domain1.com" -> (known after apply)
        # (2 unchanged attributes hidden)
    }

  # dnsimple_zone_record.domain1_com["bWFpbDIxLmV4YW1wbGUuY29tLU1YLTJteA=="] will be updated in-place
  ~ resource "dnsimple_zone_record" "domain1_com" {
        id             = "2940600"
        name           = "2mx"
      ~ priority       = "5" -> "1"
      ~ value          = "mail25.example.com" -> "mail21.example.com"
        # (5 unchanged attributes hidden)
    }

  # dnsimple_zone_record.domain1_com["bnMtMS5leGFtcGxlLmNvbS1OUy1leGFtcGxl"] will be updated in-place
  ~ resource "dnsimple_zone_record" "domain1_com" {
        id             = "2940591"
        name           = "example"
      ~ value          = "ns-3.example.com" -> "ns-1.example.com"
        # (6 unchanged attributes hidden)
    }

  # dnsimple_zone_record.domain1_com["bnMtMi5leGFtcGxlLmNvbS1OUy1leGFtcGxl"] will be updated in-place
  ~ resource "dnsimple_zone_record" "domain1_com" {
        id             = "2940584"
        name           = "example"
      ~ value          = "ns-3.example.com" -> "ns-2.example.com"
        # (6 unchanged attributes hidden)
    }

  # dnsimple_zone_record.domain1_com["bnMtNC5leGFtcGxlLmNvbS1OUy1leGFtcGxl"] will be updated in-place
  ~ resource "dnsimple_zone_record" "domain1_com" {
        id             = "2940582"
        name           = "example"
      ~ value          = "ns-3.example.com" -> "ns-4.example.com"
        # (6 unchanged attributes hidden)
    }

Plan: 3 to add, 4 to change, 3 to destroy.

Important Factoids

We have split the domain records out of terraform configuration and read them in as a set from a json file.

References

Import fails with error "nil entry in ImportState results"

When attempting to import some DNSimple records into Terraform:

terraform import "dnsimple_record.test-ns1" "example.com_123456789"

Fails with the error:

Error: nil entry in ImportState results. This is always a bug with
the resource that is being imported. Please report this as
a bug to Terraform.

Terraform Version

Terraform v0.12.29
+ provider.dnsimple v0.4.0
+ provider.external v1.2.0

Affected Resource(s)

  • dnsimple_record

Terraform Configuration Files

data "external" "dnsimple_credentials" {
  program = ["/bin/bash", "-c", "jq -c -r . /Users/XXXX/.config/dnsimple/XXXXXXX.json"]
}

provider "dnsimple" {
  token = data.external.dnsimple_credentials.result["token"]
  account = data.external.dnsimple_credentials.result["account"]
}

resource "dnsimple_record" "test-ns1" {
  domain = "example.com"
  name   = "test"
  value  = "ns1.example-dns-provider.com"
  type   = "NS"
  ttl    = 3600
}

Debug Output

https://gist.github.com/aryounce/e7ca7ef412ee05d0ddef9a890a7b3cf2

Expected Behavior

The resource should be imported into the Terraform state.

Actual Behavior

Failure with error message provided above.

Steps to Reproduce

  1. terraform import "dnsimple_record.test-ns1" "example.com_123456789"

Adds arm64 builds so it can run on macs with Apple Silicon.

Terraform Version

Terraform v0.14.7
+ provider registry.terraform.io/dnsimple/dnsimple v0.5.1
+ provider registry.terraform.io/linode/linode v1.14.3

Affected Resource(s)

(n/a)

Terraform Configuration Files

terraform {
  required_providers {
    dnsimple = {
      source  = "dnsimple/dnsimple"
      version = "0.5.1"
    }
  }
}

Debug Output

(n/a)

Panic Output

(n/a)

Expected Behavior

tf init should pass, normally.

Actual Behavior

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of linode/linode from the dependency lock file
- Reusing previous version of dnsimple/dnsimple from the dependency lock file

Error: Incompatible provider version

Provider registry.terraform.io/linode/linode v1.14.3 does not have a package
available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider may
have different platforms supported.


Error: Incompatible provider version

Provider registry.terraform.io/dnsimple/dnsimple v0.5.1 does not have a
package available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider may
have different platforms supported.

Steps to Reproduce

  1. terraform init on M1 macs with dnsimple provider.

Important Factoids

$ uname -a
Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

References

hashicorp/terraform-provider-aws#16948

Cannot set account in .tf

Terraform Version

v0.12.6

Affected Resource(s)

  • provider.dnsimple

Terraform Configuration Files

I use a module for DNS entries so I can provide the same values to multiple name servers:

# dns.tf
provider "dnsimple" {
  account "MyCompany"
  version = "~> 0.2.0"
}

module "dns_foo" {
  name = "foo.mycompany.com"
  type = "CNAME"
  value = "foo.origins.mycompany.com"
  source = "./modules/dns-entry"
}

# modules/dns-entry/variables.tf
variable "name" {}

variable "type" {
  type = string
}

variable "value" {
  type = string
}

# modules/dns-entry/main.tf
resource "dnsimple_record" "this" {
  domain = var.name
  name = var.name
  ttl = 60
  type = var.type
  value = var.value
}

resource "another_nameserver_record" "this" {
  โ€ฆ
}

Expected Behavior

The account attribute of the top-level dnsimple provider should carry through to the module.

Actual Behavior

Terraform emits this error:

Error: Missing required attribute

  on <input-prompt> line 1:
  (source code not available)

The attribute "account" is required, but no definition was found.

Steps to Reproduce

  1. declare a dnsimple provider at the top-level; include the account attribute
  2. declare a dnsimple_record resource in a module
  3. run terraform plan

Important Factoids

I don't experience this problem with provider.aws.region. I also use AWS resources in modules and declare the provider and some default attributes at the top-level.

If I remove account = "My Company" from the provider block, then terraform plan prompts me for it and it works.

The problem also goes away if I set the DNSIMPLE_ACCOUNT environment variable.

References

The modules docs describe how

Support domains/zones

Basically what it says on the tin. For me personally it's just about the zone aspect of a dnsimple domain (i.e. state=hosted) -- I do registrations with a different provider and only use dnsimple for DNS itself. It does look like you can only create domains with state=hosted through the API anyway.

How to import a dnsimple_lets_encrypt_certificate resource?

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

v1.6.3

Affected Resource(s)

dnsimple_lets_encrypt_certificate


Is it possible to import your Lets Encrypt cert resources? I don't see import mentioned on this documentation page:

https://registry.terraform.io/providers/dnsimple/dnsimple/latest/docs/resources/lets_encrypt_certificate

I tried following the same syntax as your docs suggest for importing other resource types, but received the following error in return:

โ”‚ Error: Missing Resource Import State
โ”‚
โ”‚ An unexpected error was encountered when importing the resource. This is always a problem with the provider. Please give the following information to the provider developer:
โ”‚
โ”‚ Resource ImportState method returned no State in response. If import is intentionally not supported, remove the Resource type ImportState method or return an error.

Updating DNS records throws 400 error

Terraform Version

Terraform v0.10.7

Affected Resource(s)

  • dnsimple_record

Terraform Configuration Files

resource "dnsimple_record" "app_v4" {
  domain = "${var.domain}"
  name   = "${var.name}"
  type   = "${var.type}"
  ttl    = "${var.ttl}"
  value  = "${var.value}"
}

Expected Behavior

  1. I updated the name of the domain from test-app to app in my config.
  2. I ran terraform apply
  3. I expected the update to succeed

Actual Behavior

I got an error

* dnsimple_record.app_v4: Failed to update DNSimple Record: PATCH https://api.dnsimple.com/v2/<my-account>/zones/<my-domain>/records/12561018: 400 Validation failed

I suspect what may be happening is that the provider is detecting a change and trying to do a PATCH, but a PATCH is only valid if the value is changing, not if the name is changing.

References

Possibly related to https://github.com/terraform-providers/terraform-provider-dnsimple/issues/1?

Permadiff on dnsimple_domain_delegation when name servers end in .

Terraform Version

v1.5.4

Affected Resource(s)

  • dnsimple_domain_delegation

Terraform Configuration Files

resource "dnsimple_domain" "my_domain" {
  name = "dnsimple.com"
}

resource "google_dns_managed_zone" "my_domain" {
  name        = "my-domain"
  dns_name    = "dnsimple.com."
}

resource "dnsimple_domain_delegation" "my_domain" {
  domain       = dnsimple_domain.my_domain.name
  name_servers = google_dns_managed_zone.my_domain.name_servers
}

Debug Output

Available upon request, but shouldn't be necessary.

Expected Behavior

After first apply, no changes show up in plan.

Actual Behavior

  # dnsimple_domain_delegation.my_domain must be replaced
-/+ resource "dnsimple_domain_delegation" "my_domain" {
      ~ id           = "dnsimple.com" -> (known after apply)
      ~ name_servers = [ # forces replacement
          - "ns-cloud-e1.googledomains.com",
          - "ns-cloud-e2.googledomains.com",
          - "ns-cloud-e3.googledomains.com",
          - "ns-cloud-e4.googledomains.com",
          + "ns-cloud-e1.googledomains.com.",
          + "ns-cloud-e2.googledomains.com.",
          + "ns-cloud-e3.googledomains.com.",
          + "ns-cloud-e4.googledomains.com.",
        ]
        # (1 unchanged attribute hidden)
    }

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Other

I'm happy to open a PR to address this issue, if it would help. I believe the plan just needs to be modified to treat the name server list values as equal if they match except for a trailing .. The alternative is for the API to return the values as they're provided, or for the API (or provider) to reject nameservers that end in . as invalid, if it's going to canonicalize them anyways.

`dnsimple_record` to `dnsimple_zone_record` migration unhandled

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

v1.5.7

Affected Resource(s)

It appears to affect all resources

Terraform Configuration Files

  • Migrating from an older provider version 0.13 and updating dnsimple_record resources to dnssimple_zone_record entries.
terraform {
  required_version = "~> 1.5"

  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 5.3"
    dnsimple = {
      source  = "dnsimple/dnsimple"
      version = "~> 1.3"
    }
  }
}

resource "dnsimple_zone_record" "archive" {
  zone_name = "foo.io"
  name      = "archive"
  value     = "c.storage.googleapis.com"
  type      = "CNAME"
  ttl       = 60
}

resource "dnsimple_zone_record" "domain-verification" {
  zone_name = data.googlesiteverification_dns_token.domain.domain
  name      = ""
  value     = data.googlesiteverification_dns_token.domain.record_value
  type      = data.googlesiteverification_dns_token.domain.record_type
  ttl       = 3600
}

Expected Behavior

The provider should have managed the state file alteration automatically or provided very clear directions about the issue and resolution.

Actual Behavior

 # dnsimple_zone_record.archive will be created
  + resource "dnsimple_zone_record" "archive" {
      + id             = (known after apply)
      + name           = "archive"
      + priority       = (known after apply)
      + qualified_name = (known after apply)
      + ttl            = 60
      + type           = "CNAME"
      + value          = "c.storage.googleapis.com"
      + zone_id        = (known after apply)
      + zone_name      = "foo.io"
    }

  # dnsimple_zone_record.domain-verification will be created
  + resource "dnsimple_zone_record" "domain-verification" {
      + id             = (known after apply)
      + priority       = (known after apply)
      + qualified_name = (known after apply)
      + ttl            = 3600
      + type           = "TXT"
      + value          = "google-site-verification=dfdsfdsfsdf"
      + zone_id        = (known after apply)
      + zone_name      = "foo.io"
    }

Plan: 2 to add, 1 to change, 0 to destroy.

โ”‚ Warning: Missing resource schema from provider
โ”‚
โ”‚ No resource schema found for dnsimple_record when decoding prior state
โ•ต
โ•ท
โ”‚ Warning: Missing resource schema from provider
โ”‚
โ”‚ No resource schema found for dnsimple_record when decoding prior state
โ•ต
โ•ท
โ”‚ Error: no schema available for dnsimple_record.domain-verification while reading state; this is a bug in Terraform and should be reported
โ”‚
โ”‚
โ•ต
โ•ท
โ”‚ Error: no schema available for dnsimple_record.archive while reading state; this is a bug in Terraform and should be reported
โ”‚
โ”‚

Steps to Reproduce

Please list the steps required to reproduce the issue:

  1. terraform apply

Support for HTTPs redirects

It seems like the terraform provider doesn't support setting up HTTPS redirects.

We're considering moving ~30 domains from Gandi to DNSimple. For some of them we'll delegate DNS to AWS Route 53, and have actual web servers. For them, redirects are easy.

But we also have a bunch of "parked domains", we're we're currently letting Gandi handle http/https HTTP redirects (304) to the canonical domain [without having to manage an HTTP server ourselves].

It seems like DNSimple have support for this, which is great, but there doesn't seem to be support in the Terraform provider.

Is this something you've considered adding?

image

Records with underscores in the name cannot be imported

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.11.1

  • provider.aws v1.13.0
  • provider.dnsimple v0.1.0

Affected Resource(s)

  • dnsimple_record
  • resource import functionality

Terraform Configuration Files

resource "dnssimple_record" "domain" {}

also via cli: terraform import dnsimple_record.domain _mydomain.com_1234

Expected Behavior

The record is imported into the terraform state.

Actual Behavior

Received the following:

Error importing: 1 error(s) occurred:
* dnsimple_record.domain (import id: _mydomain.com_1234): import dnsimple_record.domain (id:_mydomain.com_1234): Error Importing dnsimple_record. Please make sure the record ID is in the form DOMAIN_RECORDID (i.e. example.com_1234

Steps to Reproduce

  1. Create a DNSimple record with an underscore in it (e.g. my_domain.example.com)
  2. Create a dnsimple_record resource to import into
  3. Run the import step as described in the provider documentation

Important Factoids

The issue is in the resourceDNSimpleRecordImport func on line 191 of /dnsimple/resource_dnsimple_record.go. The length check after splitting the input domain on _ expects there to be exactly two parts, when there is the possibility for domains with underscores in them (for instance, AWS ACM certificate validation records begin with an underscore).

Shown here.

Please make a new release

Would you please make a new release of the dnsimple provider?

The sandbox flag feature is very useful for executing terraform tests with the dnsimple sandbox.

I have built the provider locally, and made use of the sandbox flag feature. But it would be great to not have to copy over the locally built binary, every time that I need to set up a test with our test automation harness.

dnsimple_lets_encrypt_certificate not working with provider version 1.1.1

Terraform Version

Terraform v1.4.6
on linux_amd64

Affected Resource(s)

  • dnsimple_lets_encrypt_certificate

Terraform Configuration Files

resource "dnsimple_lets_encrypt_certificate" "esx-4-dc1-cert" {
  domain_id  = dnsimple_domain.my_cloud.id
  auto_renew = true
  signature_algorithm = "RSA"
  name       = "esx-4.dc1"
}

Expected Behavior

cert is created

Actual Behavior

โ•ท
โ”‚ Error: Value Conversion Error
โ”‚ 
โ”‚   with dnsimple_lets_encrypt_certificate.esx-4-dc1-cert,
โ”‚ An unexpected error was encountered trying to convert the value. This is
โ”‚ always an error in the provider. Please report the following to the
โ”‚ provider developer:
โ”‚ 
โ”‚ Path: 
โ”‚ Error: target must be a pointer, got []string, which is a slice

Error creating entries on second domain

Terraform Version

1.0

Affected Resource(s)

  • dnsimple_record

Terraform Configuration Files

resource "dnsimple_record" "portal" {
  domain = "${var.stack}.${var.environment}.${var.domain}"
  name   = "portal"
  value  = "${var.stack}.${var.environment}.${var.domain}"
  type   = "CNAME"
  ttl    = 60
}

resource "dnsimple_record" "vanity-portal" {
  domain = "${var.environment}.${var.domain}"
  name   = "portal"
  value  = dnsimple_record.portal.hostname
  type   = "URL"
  ttl    = 60
}

Debug Output

Error: Failed to create DNSimple Record: POST https://api.dnsimple.com/v2/000000/zones/prototype.example.com/records: 400 Validation failed
โ”‚ 
โ”‚   with dnsimple_record.vanity-portal,
โ”‚   on dns.tf line 50, in resource "dnsimple_record" "vanity-portal":
โ”‚   50: resource "dnsimple_record" "vanity-portal" {

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

The second "vanity" domain URL should be created.

Actual Behavior

400 Validation failed

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

dnsimple_record removed in minor version release

Terraform Version

1.0.5

Affected Resource(s)

Please list the resources as a list, for example:

  • dnsimple_record

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "dnsimple_record" "slot_cname" {
   domain = var.dns_zone
   name   = var.slot_cname
   value  = data.kubernetes_service.ingress.load_balancer_ingress[0].hostname
   type   = "CNAME"
   ttl    = 300
 }

Expected Behavior

Breaking changes should result in a major version release

Actual Behavior

Breaking changes included in a minor version release, this can result in configurations that allow minor versions and patches to break unexpectedly.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

[PROPOSAL] Switch to Go Modules

As part of the preparation for Terraform v0.12, we would like to migrate all providers to use Go Modules. We plan to continue checking dependencies into vendor/ to remain compatible with existing tooling/CI for a period of time, however go modules will be used for management. Go Modules is the official solution for the go programming language, we understand some providers might not want this change yet, however we encourage providers to begin looking towards the switch as this is how we will be managing all Go projects in the future. Would maintainers please react with ๐Ÿ‘ for support, or ๐Ÿ‘Ž if you wish to have this provider omitted from the first wave of pull requests. If your provider is in support, we would ask that you avoid merging any pull requests that mutate the dependencies while the Go Modules PR is open (in fact a total codefreeze would be even more helpful), otherwise we will need to close that PR and re-run go mod init. Once merged, dependencies can be added or updated as follows:

$ GO111MODULE=on go get github.com/some/module@master
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor

GO111MODULE=on might be unnecessary depending on your environment, this example will fetch a module @ master and record it in your project's go.mod and go.sum files. It's a good idea to tidy up afterward and then copy the dependencies into vendor/. To remove dependencies from your project, simply remove all usage from your codebase and run:

$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor

Thank you sincerely for all your time, contributions, and cooperation!

Allow creating LetsEncrypt cert with multiple names

Creating a LetsEncrypt cert covering multiple names is supported by the website, and it would be nice if the terraform provider supported it as well. Currently the name argument only takes a single subdomain.

Terraform Version

v1.3.7

Affected Resource(s)

Please list the resources as a list, for example:

  • dnsimple_lets_encrypt_certificate

Terraform Configuration Files

resource "dnsimple_lets_encrypt_certificate" "combined_tls_certificate" {
  domain_id  = var.dnsimple_domain_id
  name       = "www,someothersubdomain"
  auto_renew = true
}

Expected Behavior

Single certificate covering both www and someothersubdomain is created.

Actual Behavior

Validation error

data "dnsimple_certificate" fails for certs created in the same apply

Terraform Version

โฏ terraform init -upgrade

Initializing Terraform Cloud...

Initializing provider plugins...
- Finding dnsimple/dnsimple versions matching "1.0.0"...
- Using previously-installed dnsimple/dnsimple v1.0.0
Terraform v1.4.6
on linux_amd64

Affected Resource(s)

  • data dnsimple_certificate

Terraform Configuration Files

resource "dnsimple_lets_encrypt_certificate" "esx-1-dc1-cert" {
  domain_id  = dnsimple_domain.infralovers_cloud.id
  auto_renew = true
  signature_algorithm = "RSA"
  name       = "esx-1.dc1"
}

data "dnsimple_certificate" "esx-1-dc1" {
  domain = dnsimple_lets_encrypt_certificate.esx-1-dc1-cert.domain_id
  certificate_id   = "${dnsimple_lets_encrypt_certificate.esx-1-dc1-cert.id}"
}

Expected Behavior

Get the output. There should be a wait on the data with timeout so that after creation or before download if the cert is in "ordered" state

Actual Behavior

dnsimple_lets_encrypt_certificate.esx-1-dc1-cert: Creating...
dnsimple_lets_encrypt_certificate.esx-1-dc1-cert: Creation complete after 1s [name=esx-1.dc1]
data.dnsimple_certificate.esx-1-dc1: Refreshing...
โ•ท
โ”‚ Error: failed to download DNSimple Certificate
โ”‚ 
โ”‚   with data.dnsimple_certificate.esx-1-dc1,
โ”‚   on outputs.tf line 1, in data "dnsimple_certificate" "esx-1-dc1":
โ”‚    1: data "dnsimple_certificate" "esx-1-dc1" {
โ”‚ 
โ”‚ GET
โ”‚ https://api.dnsimple.com/v2/2345/domains/324/certificates/324/download:
โ”‚ 428 Certificate not present
โ•ต
Operation failed: failed running terraform apply (exit 1)

Unable to import existed NS records

Impossible import resource for NS record.
I provided only part of DEBUG output.
I'm sure that i provided correct ID for import.

Terraform Version

+ provider registry.terraform.io/dnsimple/dnsimple v1.1.2
+ provider registry.terraform.io/hashicorp/aws v5.6.2
+ provider registry.terraform.io/hashicorp/consul v2.15.1
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hetznercloud/hcloud v1.34.3

Affected Resource(s)

  • dnsimple_zone_record

Terraform Configuration Files

resource "dnsimple_zone_record" "aws-ns" {
  for_each = toset(data.aws_route53_zone.lb.name_servers)

  zone_name = var.cdn_domain
  name   = var.lb.subdomain
  value  = each.value
  type   = "NS"
  ttl    = 3600
}

Debug Output

2023-07-10T17:16:03.280+0200 [WARN]  provider.terraform-provider-dnsimple_v1.1.2: removing zone record from state because it is not present in the remote: tf_req_id=744121ad-c985-bb6b-c6a0-ba000b4ecb5b @module=dnsimple tf_mux_provider=*proto6server.Server tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_resource_type=dnsimple_zone_record tf_rpc=ReadResource @caller=github.com/terraform-providers/terraform-provider-dnsimple/internal/framework/resources/zone_record_resource.go:224 timestamp=2023-07-10T17:16:03.280+0200
2023-07-10T17:16:03.280+0200 [DEBUG] provider.terraform-provider-dnsimple_v1.1.2: Called provider defined Resource Read: @module=sdk.framework tf_mux_provider=*proto6server.Server tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_rpc=ReadResource @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:98 tf_req_id=744121ad-c985-bb6b-c6a0-ba000b4ecb5b tf_resource_type=dnsimple_zone_record timestamp=2023-07-10T17:16:03.280+0200
2023-07-10T17:16:03.280+0200 [WARN]  Provider "registry.terraform.io/dnsimple/dnsimple" produced an unexpected new value for dnsimple_zone_record.aws-ns during refresh.
      - Root resource was present, but now absent
2023-07-10T17:16:03.280+0200 [ERROR] vertex "import dnsimple_zone_record.aws-ns result" error: Cannot import non-existent remote object
2023-07-10T17:16:03.280+0200 [ERROR] vertex "dnsimple_zone_record.aws-ns (import id \"xx-xxx.awsdns-xx.org_123456\")" error: Cannot import non-existent remote object

Panic Output

no

Expected Behavior

NS record imported successfully

Actual Behavior

Error: Cannot import non-existent remote object
โ”‚ 
โ”‚ While attempting to import an existing object to "dnsimple_zone_record.aws-ns", the provider detected that no object exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or
โ”‚ use "terraform apply" to create a new remote object for this resource.

Steps to Reproduce

terraform import dnsimple_zone_record.aws-ns xx-xxxx.awsdns-xx.org_123456

Important Factoids

Nothing special

References

None

DNSimple resources are incompatible with AWS resources

Suppose you want to create an ACM certificate using the https://www.terraform.io/docs/providers/aws/r/acm_certificate.html resource.

It would output

  • domain_name - The domain to be validated
  • resource_record_name - The name of the DNS record to create to validate the certificate
  • resource_record_type - The type of DNS record to create
  • resource_record_value - The value the DNS record needs to have

domain_name and resource_record_name are full FQDNs.

DNSimple needs two parameters domain + subdomain.

Please change DNSimple in order to be able to specify the intended FQDN instead of the two parameters

Labeling domains

Are there any plans for introducing support in Terraform to add labels to a domain similar to what you can do today via the UI?

Maybe the challenge is that it's not available in the API yet?

Thanks. ( And thanks for writing the plugin)

Implement DNSimple Registrar API

I've got a feature request:
I'd love to be able to register domains via Terraform, DNSimple seems to have an API for Registrar stuff, too... Do you think it'd be possible to implement this into the provider as well?

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.