From b7e16c6b533fba2c946e26f7f56736d1ae451011 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 26 Aug 2014 15:05:36 -0700 Subject: [PATCH] providers/aws: source_dest_check applies [GH-229] --- builtin/providers/aws/resource_aws_instance.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index 3427d44cd..1b15a4052 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -15,16 +15,6 @@ import ( "github.com/mitchellh/goamz/ec2" ) -/* - PreProcess: map[string]diff.PreProcessFunc{ - "user_data": func(v string) string { - hash := sha1.Sum([]byte(v)) - return hex.EncodeToString(hash[:]) - }, - }, - } -*/ - func resourceAwsInstance() *schema.Resource { return &schema.Resource{ Create: resourceAwsInstanceCreate, @@ -226,9 +216,10 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { modify := false opts := new(ec2.ModifyInstance) - if d.HasChange("source_dest_check") { - opts.SourceDestCheck = d.Get("source_dest_check").(bool) + if v, ok := d.GetOk("source_dest_check"); ok { + opts.SourceDestCheck = v.(bool) opts.SetSourceDestCheck = true + modify = true } if modify {