func resourceSoftLayerSSHKeyCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*Client).sshKeyService // Build up our creation options opts := datatypes.SoftLayer_Security_Ssh_Key{ Label: d.Get("name").(string), Key: d.Get("public_key").(string), } if notes, ok := d.GetOk("notes"); ok { opts.Notes = notes.(string) } res, err := client.CreateObject(opts) if err != nil { return fmt.Errorf("Error creating SSH Key: %s", err) } d.SetId(strconv.Itoa(res.Id)) log.Printf("[INFO] SSH Key: %d", res.Id) return resourceSoftLayerSSHKeyRead(d, meta) }