providers/aws: use StateFunc to process the user_data

This commit is contained in:
Mitchell Hashimoto 2014-08-22 08:46:48 -07:00
parent f26a2700a1
commit ba68be5672
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package aws
import (
"crypto/sha1"
"encoding/hex"
"fmt"
"log"
"strings"
@ -84,7 +86,10 @@ func resourceAwsInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
// TODO: Process
StateFunc: func(v interface{}) string {
hash := sha1.Sum([]byte(v.(string)))
return hex.EncodeToString(hash[:])
},
},
"security_groups": &schema.Schema{