aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mailgun/resource_mailgun_domain.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/mailgun/resource_mailgun_domain.go b/mailgun/resource_mailgun_domain.go
index eaf00fa..988b80c 100644
--- a/mailgun/resource_mailgun_domain.go
+++ b/mailgun/resource_mailgun_domain.go
@@ -205,6 +205,14 @@ func resourceMailgunDomain() *schema.Resource {
205 } 205 }
206} 206}
207 207
208func interfaceToStringTab(i interface{}) []string {
209 aInterface := i.([]interface{})
210 aString := make([]string, len(aInterface))
211 for i, v := range aInterface {
212 aString[i] = v.(string)
213 }
214 return aString
215}
208func CreateDomain(d *schema.ResourceData, meta interface{}) error { 216func CreateDomain(d *schema.ResourceData, meta interface{}) error {
209 mg := meta.(*mailgun.MailgunImpl) 217 mg := meta.(*mailgun.MailgunImpl)
210 ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) 218 ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
@@ -218,7 +226,7 @@ func CreateDomain(d *schema.ResourceData, meta interface{}) error {
218 Wildcard: d.Get("wildcard").(bool), 226 Wildcard: d.Get("wildcard").(bool),
219 ForceDKIMAuthority: d.Get("force_dkim_authority").(bool), 227 ForceDKIMAuthority: d.Get("force_dkim_authority").(bool),
220 DKIMKeySize: d.Get("dkim_key_size").(int), 228 DKIMKeySize: d.Get("dkim_key_size").(int),
221 IPS: d.Get("ips").([]string), 229 IPS: interfaceToStringTab(d.Get("ips")),
222 }) 230 })
223 231
224 if err != nil { 232 if err != nil {
@@ -432,7 +440,7 @@ func ReadDomain(d *schema.ResourceData, meta interface{}) error {
432 if err != nil { 440 if err != nil {
433 return fmt.Errorf("Error Getting mailgun credentials for %s: Error: %s", d.Id(), err) 441 return fmt.Errorf("Error Getting mailgun credentials for %s: Error: %s", d.Id(), err)
434 } 442 }
435 443
436 credentials := make([]map[string]interface{}, len(credentialsResponse)) 444 credentials := make([]map[string]interface{}, len(credentialsResponse))
437 for i, r := range credentialsResponse { 445 for i, r := range credentialsResponse {
438 credentials[i] = make(map[string]interface{}) 446 credentials[i] = make(map[string]interface{})