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

Cloudflare record import support #5

Closed
hashibot opened this issue Jun 13, 2017 · 10 comments
Closed

Cloudflare record import support #5

hashibot opened this issue Jun 13, 2017 · 10 comments
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.

Comments

@hashibot
Copy link

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


Terraform Version

All.

Affected Resource(s)

Please list the resources as a list, for example:

Expected Behavior

Terraform supports import of existing cloudflare records into state.

Important Factoids

Need to determine how the record would be referenced:

  • Record ID
  • Full DNS name (may be ambiguous as you could have multiple types of records for the same domain)

References

First reported in hashicorp/terraform#3715 but closed as terraform import wasn't a thing.

@hashibot hashibot added the kind/enhancement Categorizes issue or PR as related to improving an existing feature. label Jun 13, 2017
@glesperance
Copy link

Not sure how your ticketing system works but are there any progress on this?
Thanks!

@grubernaut
Copy link
Contributor

grubernaut commented Jun 29, 2017

Hey @mwarkentin + @glesperance, thanks for the issue!

While, I would absolutely love to be able to add this functionality to cloudflare_record, it's currently not possible inside of Terraform. More info on 'why' can be found here: hashicorp/terraform#14497 (comment), but tl;dr:

Terraform Import accepts a single key after the resource identifier, usually that specific resource's id. Terraform then attempts that resources Read method to populate all of the schema objects possible for the resource based on that resource's ID. This works fine in the majority of cases. However, with the cloudflare_record resource, the domain attribute is also a required attribute in order to call the resource's Read method. During an import, this attribute is nil, and the Read method will fail.

We have had discussions internally, mostly around UX, on how to allow for multiple variable imports to happen, so as to bypass this issue, but with the 0.10 changes coming, it may be a while yet before we can circle back to adding this functionality.

Once again, I'm sorry we cannot fulfill this request at this time, as I would personally love to be able to add cloudflare_record import functionality, but it's currently not possible in Terraform.

Going to leave this issue open, however, so duplicate feature requests aren't opened.

@lczxpplnzeey
Copy link

like to bump this and hopefully this can be circled back to eventually.

@mwarkentin
Copy link

It looks like there's a PR for it that's been sitting for a while: https://github.com/terraform-providers/terraform-provider-cloudflare/pull/19

@fillup
Copy link

fillup commented Jan 17, 2018

@grubernaut as @mwarkentin made the link, I have a PR open that works around this issue of a single import variable. It isn't the most elegant solution but it does work and gets the job done. I'd love to see the PR merged in as it looks like quite a few people are waiting for this so we don't have to delete and recreate our DNS records.

@evq
Copy link

evq commented Feb 8, 2018

We have an importer script in the style of terraforming for this that might be useful to others for bulk import - https://github.com/brave/cf2tf

@tdmalone
Copy link

I came here after trying to import a cloudflare_record and getting an error saying it wasn't supported.

For some reason... the docs say it is supported, I'm not sure why that is!

@tdmalone
Copy link

^ I've logged #52 to remove the docs that say import is possible.. until #19 can be merged.

simpsora pushed a commit to simpsora/terraform-provider-cloudflare that referenced this issue Jun 20, 2018
…le-host_header_override

missing bracket after merge conflict
@garrettgalow
Copy link
Contributor

@patryk also fixed by #36

@patryk
Copy link
Contributor

patryk commented Jul 17, 2018

Record importing is supported. Closing.

@patryk patryk closed this as completed Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants