diff --git a/builtin/providers/aws/resource_aws_security_group.go b/builtin/providers/aws/resource_aws_security_group.go index c673cb1f7..cff8222e0 100644 --- a/builtin/providers/aws/resource_aws_security_group.go +++ b/builtin/providers/aws/resource_aws_security_group.go @@ -149,7 +149,7 @@ func resourceAwsSecurityGroupCreate(d *schema.ResourceData, meta interface{}) er securityGroupOpts := &ec2.CreateSecurityGroupInput{} - if v := d.Get("vpc_id"); v != nil { + if v, ok := d.GetOk("vpc_id"); ok { securityGroupOpts.VPCID = aws.String(v.(string)) }