-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Make dnsimple_records importable #9130
Conversation
Before I continue down this path much further, I'm interested in feedback on the approach. Do any other providers require 2+ pieces of data as inputs to the import? Is a |
f5e01e0
to
2de36cf
Compare
@stack72 are you able to offer any feedback on this PR as well? I've attempted to add support for importing |
This looks super neat! Could you read the domain itself as well to confirm the ID/name? This would mean it could be imported with either ID or domain name as a single parameter, too. |
Thanks @sj26
Could you describe this in a bit more detail? I'm still wrapping my head around both terraform and the dnsimple API, so I haven't totally grokked your suggestion. |
Hi @yob This is looking good! We follow a similar pattern for importing AWS Route53 Records Paul |
Cheers, I'll checkout the route53 example for tips |
@stack72 I've rebased this onto master, and adjusted the import syntax to use the same delimiter ( I've added a spec and some documentation, and I've confirmed the import works in my dev environment. Does this need anything else to be considered for merging? |
hi @stack72 - when you have time I'd love some additional feedback on this |
sorry to be a broken wheel @stack72, but this is the only remaining blocker to us using terraform in production. Is there anything I can do to get it over the line? |
Hi @yob Apologies for the lack of response here - this repo is crazy busy and this slipped past my radar! The code looks good to me :) The tests don't quite pass as expected:
Paul |
Thanks for the feedback, and apologies for not noticing that the travis build doesn't include acceptance specs. I've reproduced the failure locally and had a go at resolving it, but I'm bumping up against my terraform knowledge. The import command I've added requires the ID to be provided as |
terraform 0.7 supports importing a resource into the local state, and this adds that feature to the dnsimple_record resource. Unfortunately, the DNSimple v1 API requires a domain name and record ID to fetch a record, so the import command accepts both pieces of data as a slash-delimted string like so: terraform import dnsimple_record.test example.com/1234
Yay! Nice work @yob :) Tests are now looking great!
Thanks for this - merging now Paul |
Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This makes the
dnsimple_record
resource importable.Unfortunately, the DNSimple v2 API requires a domain name and record ID to fetch a record, so the import command accepts both pieces of data as an underscore delimited string like so:
The underscore delimited approach is very similar to the one used to import an aws_route53_record resource.
The numeric resource ID is visible in the URL when editing a record on the dnsimple dashboard (ie. the
1234
in https://dnsimple.com/a/xxx/domains/example.com/records/1234/edit