From e9b08cf31fdf3f6e5f18c7c46a7a4ae0577f7442 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Tue, 5 May 2015 16:22:18 -0500 Subject: [PATCH] revert the required part --- builtin/providers/aws/resource_aws_security_group.go | 8 ++------ .../docs/providers/aws/r/security_group.html.markdown | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/builtin/providers/aws/resource_aws_security_group.go b/builtin/providers/aws/resource_aws_security_group.go index aa4d85b3de..c619e70885 100644 --- a/builtin/providers/aws/resource_aws_security_group.go +++ b/builtin/providers/aws/resource_aws_security_group.go @@ -148,13 +148,9 @@ func resourceAwsSecurityGroupCreate(d *schema.ResourceData, meta interface{}) er securityGroupOpts := &ec2.CreateSecurityGroupInput{} - if v, ok := d.GetOk("vpc_id"); ok { - if len(d.Get("egress").(*schema.Set).List()) == 0 { - return fmt.Errorf("Error creating Security Group: Security groups inside a VPC require an egress rule. See http://terraform.io/docs/providers/aws/r/security_group.html for more information.") - } - + if v := d.Get("vpc_id"); v != nil { securityGroupOpts.VPCID = aws.String(v.(string)) - } + } if v := d.Get("description"); v != nil { securityGroupOpts.Description = aws.String(v.(string)) diff --git a/website/source/docs/providers/aws/r/security_group.html.markdown b/website/source/docs/providers/aws/r/security_group.html.markdown index f5ffb85855..7651549060 100644 --- a/website/source/docs/providers/aws/r/security_group.html.markdown +++ b/website/source/docs/providers/aws/r/security_group.html.markdown @@ -63,7 +63,7 @@ The following arguments are supported: * `description` - (Required) The security group description. * `ingress` - (Optional) Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. -* `egress` - (Required, VPC only) Can be specified multiple times for each +* `egress` - (Optional, VPC only) Can be specified multiple times for each egress rule. Each egress block supports fields documented below. * `vpc_id` - (Optional) The VPC ID. * `tags` - (Optional) A mapping of tags to assign to the resource.