diff options
author | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-07-02 15:33:00 +0200 |
---|---|---|
committer | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-07-02 15:33:00 +0200 |
commit | 61f3e5537efb3565a92969b40ff51cae59344415 (patch) | |
tree | 3e6b91a6a2bdf10d48ee72c1f24d52196ce76278 /mailgun | |
parent | 5c1feb2c5fe3962a8c5c1caffb81d6526eedf992 (diff) | |
download | terraform-provider-mailgun-61f3e5537efb3565a92969b40ff51cae59344415.tar.gz terraform-provider-mailgun-61f3e5537efb3565a92969b40ff51cae59344415.tar.zst terraform-provider-mailgun-61f3e5537efb3565a92969b40ff51cae59344415.zip |
fix create
Diffstat (limited to 'mailgun')
-rw-r--r-- | mailgun/resource_mailgun_domain.go | 12 |
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 | ||
208 | func 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 | } | ||
208 | func CreateDomain(d *schema.ResourceData, meta interface{}) error { | 216 | func 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{}) |