Open ericksoen opened 4 years ago
It might also be useful to not that the id "shiny-app.domain.com.domain.com" is in the form name.zone
and the name ends with the zone. This would be helpful in parsing the id.
func parse(id string) (name, zone string) {
var id_parts = strings.Split(id, ".");
for x := len(id_parts) - 1 ; x >=0; x -- {
var n = strings.Join(id_parts[0:x], ".")
var z = strings.Join(id_parts[x:], ".")
if len(n) < len(z) {
break
}
if strings.HasSuffix(n, z) {
name = n
zone = z
return
}
}
return
}
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Expected Behavior
Terraform import adds resource to state file and refreshes
Actual Behavior
Resource does not support import
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
From some initial investigation, it looks like there are two primary issues (beyond the missing
Importer
func on the resource record) that complicate an elegant solution:OwnerName.Zone
uses a period as delimiter character, making it difficult to accurately parse out the constituent parts necessary to run the refresh operation post-import. In the example above, the resource id includes four.
characters.Type
property necessary to construct a valid request to the UltraDNS API.References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: