Fix instance attributes

This commit is contained in:
Jake Champlin 2017-04-05 18:14:11 -04:00
parent 9062ddded3
commit 871d33d90d
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
1 changed files with 10 additions and 7 deletions

View File

@ -51,12 +51,10 @@ func resourceInstance() *schema.Resource {
// Optional Attributes // // Optional Attributes //
///////////////////////// /////////////////////////
"instance_attributes": { "instance_attributes": {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
ForceNew: true, ForceNew: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { ValidateFunc: validation.ValidateJsonString,
return true
},
}, },
"boot_order": { "boot_order": {
@ -367,7 +365,12 @@ func resourceInstanceCreate(d *schema.ResourceData, meta interface{}) error {
} }
// Get optional instance attributes // Get optional instance attributes
if attributes, err := getInstanceAttributes(d); err != nil && attributes != nil { attributes, attrErr := getInstanceAttributes(d)
if attrErr != nil {
return attrErr
}
if attributes != nil {
input.Attributes = attributes input.Attributes = attributes
} }