providers/aws: use StateFunc to process the user_data
This commit is contained in:
parent
f26a2700a1
commit
ba68be5672
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue