From f2ddb53c8faa01f6cce7a6c541885c47e6b89952 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 6 May 2015 10:32:17 -0700 Subject: [PATCH] provider/aws: only include network in hash if instance is not set --- builtin/providers/aws/resource_aws_route_table.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_route_table.go b/builtin/providers/aws/resource_aws_route_table.go index a3afba41f..0c2190ec3 100644 --- a/builtin/providers/aws/resource_aws_route_table.go +++ b/builtin/providers/aws/resource_aws_route_table.go @@ -351,7 +351,9 @@ func resourceAwsRouteTableHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } + instanceSet := false if v, ok := m["instance_id"]; ok { + instanceSet = v.(string) != "" buf.WriteString(fmt.Sprintf("%s-", v.(string))) } @@ -359,7 +361,7 @@ func resourceAwsRouteTableHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } - if v, ok := m["network_interface_id"]; ok { + if v, ok := m["network_interface_id"]; ok && !instanceSet { buf.WriteString(fmt.Sprintf("%s-", v.(string))) }