From b58e468033d1dbee273a8236870f47afcffd1242 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Wed, 17 Dec 2014 23:53:01 +0100 Subject: [PATCH] Updated the security_group attribute to use a set This way the order returned by the API has no impact on the saved state, preventing false positives when diffing. --- builtin/providers/aws/resource_aws_elb.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_elb.go b/builtin/providers/aws/resource_aws_elb.go index c981eaba4..54b43572a 100644 --- a/builtin/providers/aws/resource_aws_elb.go +++ b/builtin/providers/aws/resource_aws_elb.go @@ -58,11 +58,14 @@ func resourceAwsElb() *schema.Resource { // TODO: could be not ForceNew "security_groups": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, Optional: true, ForceNew: true, Computed: true, + Set: func(v interface{}) int { + return hashcode.String(v.(string)) + }, }, // TODO: could be not ForceNew @@ -179,7 +182,7 @@ func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error { } if v, ok := d.GetOk("security_groups"); ok { - elbOpts.SecurityGroups = expandStringList(v.([]interface{})) + elbOpts.SecurityGroups = expandStringList(v.(*schema.Set).List()) } if v, ok := d.GetOk("subnets"); ok {