Merge pull request #1197 from hashicorp/b-fix-user-data-encoding
provider/aws: Fix encoding bug with AWS Instance
This commit is contained in:
commit
c30cb09c80
|
@ -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