provider/aws: Fix encoding bug with AWS Instance
This commit is contained in:
parent
96c41de946
commit
d5f23aec0a
|
@ -3,6 +3,7 @@ package aws
|
|||
import (
|
||||
"bytes"
|
||||
"crypto/sha1"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"log"
|
||||
|
@ -258,7 +259,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
// Figure out user data
|
||||
userData := ""
|
||||
if v := d.Get("user_data"); v != nil {
|
||||
userData = v.(string)
|
||||
userData = base64.StdEncoding.EncodeToString([]byte(v.(string)))
|
||||
}
|
||||
|
||||
placement := &ec2.Placement{
|
||||
|
|
|
@ -392,7 +392,7 @@ resource "aws_instance" "foo" {
|
|||
|
||||
instance_type = "m1.small"
|
||||
security_groups = ["${aws_security_group.tf_test_foo.name}"]
|
||||
user_data = "foo"
|
||||
user_data = "foo:-with-character's"
|
||||
}
|
||||
`
|
||||
|
||||
|
|
Loading…
Reference in New Issue