Closed jamesarosen closed 4 years ago
I've now also tried this with an Account Token:
curl -H 'Authorization: Bearer MYACCOUNTTOKEN' https://api.dnsimple.com/v2/whoami
{
"data": {
"user": null,
"account": {
"id": 7812,
"email": "me@mycompany.com",
"plan_identifier":"silver-v2-monthly",
"created_at":"2012-07-20T08:16:56Z",
"updated_at":"2019-07-18T03:55:54Z"
}
}
}
But I get the same result when running terraform import
.
Oh! I finally figured it out. The Terraform object ID is mycompany.com_123456789
, not www.mycompany.com_123456789
. It's
terraform import dnsimple_record.child parent.com_CHILDID
I definitely didn't understand the docs. It would be lovely to make that distinction a little clearer!
I definitely didn't understand the docs. It would be lovely to make that distinction a little clearer!
Can you point me to the docs that is misleading?
https://www.terraform.io/docs/providers/dnsimple/r/record.html#import says
DNSimple resources can be imported using their domain name and numeric ID, e.g.
$ terraform import dnsimple_record.resource_name example.com_1234
The numeric ID can be found in the URL when editing a record on the dnsimple web dashboard.
"domain name" is ambiguous. www.example.com
is a fully-qualified domain name. example.com
is an apex domain.
In the context of dnsimple, www.example.com
and example.com
are both records of the example.com
domain.
The documentation uses the terms "domain" as argument, and "hostname" as attribute. The "hostname" is the fully-qualified record name you are referring to.
I expanded the examples a bit so hopefully this is more clear. Thanks for the feedback.
Terraform Version
0.12.6
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terraform import dnsimple_record.www_mycompany_com www.mycompany.com_123456789
should import the domain.Actual Behavior
What actually happened?
Steps to Reproduce
export DNSIMPLE_ACCOUNT=1234
export DNSIMPLE_TOKEN=abcde12345ABCDE
dnsimple_record
resourceterraform 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
I get back
I'm not 100% sure that I have the right thing set for
DNSIMPLE_ACCOUNT
. I've tried:12345
from the URL in https://dnsimple.com/a/12345/account when I click on "Account" in the UI9876
from the response toGET https://api.dnsimple.com/v2/whoami
"MyCompany"