provider/aws: Fix encoding bug with AWS Instance

This commit is contained in:
Clint Shryock 2015-03-13 10:54:00 -05:00
parent 96c41de946
commit d5f23aec0a
2 changed files with 3 additions and 2 deletions

View File

@ -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{

View File

@ -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"
}
`