provider/aws: ignore empty vpc_security_group_ids

fixes #2293
This commit is contained in:
Paul Hinze 2015-06-11 07:59:42 -05:00
parent efab07f7af
commit d41c9d46a8
1 changed files with 6 additions and 6 deletions

View File

@ -539,8 +539,8 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
if d.HasChange("vpc_security_group_ids") {
var groups []*string
if v := d.Get("vpc_security_group_ids"); v != nil {
for _, v := range v.(*schema.Set).List() {
if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 {
for _, v := range v.List() {
groups = append(groups, aws.String(v.(string)))
}
}
@ -908,8 +908,8 @@ func buildAwsInstanceOpts(
ni.PrivateIPAddress = aws.String(v.(string))
}
if v := d.Get("vpc_security_group_ids"); v != nil {
for _, v := range v.(*schema.Set).List() {
if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 {
for _, v := range v.List() {
ni.Groups = append(ni.Groups, aws.String(v.(string)))
}
}
@ -930,8 +930,8 @@ func buildAwsInstanceOpts(
opts.SecurityGroups = groups
}
if v := d.Get("vpc_security_group_ids"); v != nil {
for _, v := range v.(*schema.Set).List() {
if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 {
for _, v := range v.List() {
opts.SecurityGroupIDs = append(opts.SecurityGroupIDs, aws.String(v.(string)))
}
}