From 0c5011bea47ffd9bad683b4f1dd8ecebae76e67d Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Tue, 21 Apr 2015 10:57:50 -0500 Subject: [PATCH] provider/aws: Fix issue with empty IPRanges --- builtin/providers/aws/structure.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin/providers/aws/structure.go b/builtin/providers/aws/structure.go index 1c01f89f6454..2f22d6e3a9e9 100644 --- a/builtin/providers/aws/structure.go +++ b/builtin/providers/aws/structure.go @@ -93,9 +93,8 @@ func expandIPPerms( if raw, ok := m["cidr_blocks"]; ok { list := raw.([]interface{}) - perm.IPRanges = make([]*ec2.IPRange, len(list)) - for i, v := range list { - perm.IPRanges[i] = &ec2.IPRange{CIDRIP: aws.String(v.(string))} + for _, v := range list { + perm.IPRanges = append(perm.IPRanges, &ec2.IPRange{CIDRIP: aws.String(v.(string))}) } }