provider/aws: only include network in hash if instance is not set

This commit is contained in:
Mitchell Hashimoto 2015-05-06 10:32:17 -07:00
parent 7311019efe
commit f2ddb53c8f
1 changed files with 3 additions and 1 deletions

View File

@ -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)))
}