Skip to content

Commit

Permalink
Merge pull request #12616 from spavuluri/6036-sg-import-remove-rules
Browse files Browse the repository at this point in the history
Do not import aws_security_group_rule for associated rules during aws_security_group import
  • Loading branch information
anGie44 authored Jul 15, 2020
2 parents e003869 + 0297e0a commit 2db7d7f
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 307 deletions.
175 changes: 0 additions & 175 deletions aws/import_aws_security_group.go

This file was deleted.

5 changes: 3 additions & 2 deletions aws/resource_aws_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func resourceAwsSecurityGroup() *schema.Resource {
Update: resourceAwsSecurityGroupUpdate,
Delete: resourceAwsSecurityGroupDelete,
Importer: &schema.ResourceImporter{
State: resourceAwsSecurityGroupImportState,
State: schema.ImportStatePassthrough,
},

Timeouts: &schema.ResourceTimeout{
Expand Down Expand Up @@ -383,8 +383,9 @@ func resourceAwsSecurityGroupRead(d *schema.ResourceData, meta interface{}) erro
d.Set("arn", sgArn.String())
d.Set("description", sg.Description)
d.Set("name", sg.GroupName)
d.Set("vpc_id", sg.VpcId)
d.Set("name_prefix", aws.StringValue(naming.NamePrefixFromName(aws.StringValue(sg.GroupName))))
d.Set("owner_id", sg.OwnerId)
d.Set("vpc_id", sg.VpcId)

if err := d.Set("ingress", ingressRules); err != nil {
log.Printf("[WARN] Error setting Ingress rule set for (%s): %s", d.Id(), err)
Expand Down
Loading

0 comments on commit 2db7d7f

Please sign in to comment.