providers/aws: use StateFunc to process the user_data
This commit is contained in:
parent
f26a2700a1
commit
ba68be5672
|
@ -1,6 +1,8 @@
|
||||||
package aws
|
package aws
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/sha1"
|
||||||
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -84,7 +86,10 @@ func resourceAwsInstance() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
// TODO: Process
|
StateFunc: func(v interface{}) string {
|
||||||
|
hash := sha1.Sum([]byte(v.(string)))
|
||||||
|
return hex.EncodeToString(hash[:])
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"security_groups": &schema.Schema{
|
"security_groups": &schema.Schema{
|
||||||
|
|
Loading…
Reference in New Issue