Skip to content

Commit

Permalink
providers/aws: use StateFunc to process the user_data
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Aug 22, 2014
1 parent f26a270 commit ba68be5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/providers/aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package aws

import (
"crypto/sha1"
"encoding/hex"
"fmt"
"log"
"strings"
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit ba68be5

Please sign in to comment.