Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a single record without removing existing records #33

Open
guysaha1 opened this issue Jan 16, 2020 · 8 comments
Open

Add a single record without removing existing records #33

guysaha1 opened this issue Jan 16, 2020 · 8 comments
Labels
awaiting feedback Awaiting feedback from user

Comments

@guysaha1
Copy link

I have a domain that I purchased from GoDaddy, let's call it "domain.com".

I want to use this plugin to add a dns record that maps my google_compute_instance which has a static google_compute_address to a subdomain, let's call it "subdomain.domain.com".

To do this I added a godaddy_domain_record resource with a single record.

The problem is that I have additional records which are used for "domain.com" and for other subdomains under it.
According to your documentation my configuration will cause Terraform to replace all my existing records with just that one record that I specified in my configuration (unless I misunderstood the documentation).

I don't want to specify all my dns records in my Terraform configuration, I only want to specify the ones that are used by this specific google_compute_instance. I also still want to be able to add dns records manually through the GoDaddy website.

@guysaha1
Copy link
Author

I saw the following 2 closed issues that are related to my problem:
#14 #8
I understand that this behavior is by design, but I'd still like to have support for my use case using this plugin if possible.

@n3integration
Copy link
Owner

@guysaha1 - if I understand the behavior described above, using Terraform's import feature might do the trick. Please let me know if this resolves the issue being described.

@n3integration n3integration added the awaiting feedback Awaiting feedback from user label Feb 26, 2020
@ferdinandosimonetti
Copy link

ferdinandosimonetti commented Aug 13, 2020

Hello, I'd like to use this provider from within Terraform Cloud.
So, having an already populated domain (with MX records for my business email and so on), I'd like to know how to proceed.
Should I first perform an import locally, extracting domain records from the state file?
Thanks in advance.

EDIT I've performed " terraform import godaddy_domain_record.fsimonetti-eu fsimonetti.eu" but I can't find any NS records within the state file.

Attached you can find the output of "host -t ns" for my domain, my starting point main.tf, the command I performed, and an edited representation of the state file.

terraform-state-godaddy-fsimonetti-eu.txt

@tekmanic
Copy link

@n3integration I have come across the same issue as @guysaha1. I would like to simply write a single record into my domain but the plugin will erase all other records on apply. I think the terraform import command would solve this problem for me but based on the documentation seems tedious. Do you have any suggestions on how to import all the records of the domain before writing the new one in?

@EduardoSantanaSeverino
Copy link

Same here as guysaha1. Do you have any suggestions on how to import all the records of the domain before writing the new one in?

@infrastructure-natoora
Copy link

Hi,

I am facing the same issue. I am trying to add just a single record based on automation every time we create a new server that needs an URL, however, when the record is added it will wipe out all other records.

For example, if you use ACME to add ssl automatically, it will add a new TXT record in godaddy next to the other records, but if I add a record using terraform, it will not append, it will remove the others and keep only this record.

I was thinking if there is a way to have the record as a resource in main.tf, not the domain.com as resource, maybe this will fix so all records are individual rather than domain.com.

Does this make sense ?

@b1collector
Copy link

To those interested in this ticket: check out https://github.com/anna-kampani/terraform-provider-godaddy. They appear to have forked and solved this problem.

@veksh
Copy link

veksh commented Jan 3, 2024

To those interested in this ticket: check out https://github.com/anna-kampani/terraform-provider-godaddy. They appear to have forked and solved this problem.

Facing similar issues, I've decided to re-implement provider from scratch to operate on record level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting feedback from user
Projects
None yet
Development

No branches or pull requests

8 participants