Delete: DeleteDomain,
Read: ReadDomain,
Importer: &schema.ResourceImporter{
- State: schema.ImportStatePassthrough,
+ State: ImportStatePassthroughDomain,
},
Schema: map[string]*schema.Schema{
if err != nil {
return fmt.Errorf("Error Getting mailgun domain Details for %s: Error: %s", d.Id(), err)
}
- if _, ok := d.GetOk("dkim_key_size"); !ok {
- d.Set("dkim_key_size", 1024)
- }
-
- if _, ok := d.GetOk("force_dkim_authority"); !ok {
- d.Set("force_dkim_authority", false)
- }
d.Set("created_at", domainResponse.Domain.CreatedAt)
d.Set("smtd_login", domainResponse.Domain.SMTPLogin)
}
return result, nil
}
+
+func ImportStatePassthroughDomain(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
+ if _, ok := d.GetOk("dkim_key_size"); !ok {
+ d.Set("dkim_key_size", 1024)
+ }
+
+ if _, ok := d.GetOk("force_dkim_authority"); !ok {
+ d.Set("force_dkim_authority", false)
+ }
+ return []*schema.ResourceData{d}, nil
+}