From 3c4d1791e5d0f89efd244f55848fbf8312306b82 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Wed, 18 Feb 2015 17:46:50 -0600 Subject: [PATCH] providers/aws: fix aws_instance source_dest_check Was relying on old behavior of GetOk and therefore never properly seeing a change from true -> false. This fixes the acceptance test failure of `TestAccAWSInstance_sourceDestCheck`. --- builtin/providers/aws/resource_aws_instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index d6ac3ef2f..789297815 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -491,9 +491,9 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { modify := false opts := new(ec2.ModifyInstance) - if v, ok := d.GetOk("source_dest_check"); ok { - opts.SourceDestCheck = v.(bool) + if d.HasChange("source_dest_check") { opts.SetSourceDestCheck = true + opts.SourceDestCheck = d.Get("source_dest_check").(bool) modify = true }