diff --git a/builder/amazon/common/build_filter.go b/builder/amazon/common/build_filter.go
index <HASH>..<HASH> 100644
--- a/builder/amazon/common/build_filter.go
+++ b/builder/amazon/common/build_filter.go
@@ -8,9 +8,11 @@ import (
 func buildEc2Filters(input map[string]string) []*ec2.Filter {
 	var filters []*ec2.Filter
 	for k, v := range input {
+		a := k
+		b := v
 		filters = append(filters, &ec2.Filter{
-			Name:   &k,
-			Values: []*string{&v},
+			Name:   &a,
+			Values: []*string{&b},
 		})
 	}
 	return filters
need to initialize variables scoped to the individual loop, because the address of k,v stay the same and that means we overwrite previous variables when assigning them to the struct directly.