Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security_group: Destroying takes forever improvements #30114

Merged
merged 7 commits into from
Mar 20, 2023

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Mar 18, 2023

Description

Relations

Closes #265

References

Output from Acceptance Testing

% make ts T=TestAccVPCSecurityGroup_ K=vpc               
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -short -count 1 -parallel 20 -run='TestAccVPCSecurityGroup_'  -timeout 180m
=== RUN   TestAccVPCSecurityGroup_basic
=== PAUSE TestAccVPCSecurityGroup_basic
=== RUN   TestAccVPCSecurityGroup_disappears
=== PAUSE TestAccVPCSecurityGroup_disappears
=== RUN   TestAccVPCSecurityGroup_noVPC
=== PAUSE TestAccVPCSecurityGroup_noVPC
=== RUN   TestAccVPCSecurityGroup_nameGenerated
=== PAUSE TestAccVPCSecurityGroup_nameGenerated
=== RUN   TestAccVPCSecurityGroup_nameTerraformPrefix
=== PAUSE TestAccVPCSecurityGroup_nameTerraformPrefix
=== RUN   TestAccVPCSecurityGroup_namePrefix
=== PAUSE TestAccVPCSecurityGroup_namePrefix
=== RUN   TestAccVPCSecurityGroup_namePrefixTerraform
=== PAUSE TestAccVPCSecurityGroup_namePrefixTerraform
=== RUN   TestAccVPCSecurityGroup_tags
=== PAUSE TestAccVPCSecurityGroup_tags
=== RUN   TestAccVPCSecurityGroup_allowAll
=== PAUSE TestAccVPCSecurityGroup_allowAll
=== RUN   TestAccVPCSecurityGroup_sourceSecurityGroup
=== PAUSE TestAccVPCSecurityGroup_sourceSecurityGroup
=== RUN   TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules
=== PAUSE TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules
=== RUN   TestAccVPCSecurityGroup_ipRangesWithSameRules
=== PAUSE TestAccVPCSecurityGroup_ipRangesWithSameRules
=== RUN   TestAccVPCSecurityGroup_egressMode
=== PAUSE TestAccVPCSecurityGroup_egressMode
=== RUN   TestAccVPCSecurityGroup_ingressMode
=== PAUSE TestAccVPCSecurityGroup_ingressMode
=== RUN   TestAccVPCSecurityGroup_ruleGathering
=== PAUSE TestAccVPCSecurityGroup_ruleGathering
=== RUN   TestAccVPCSecurityGroup_forceRevokeRulesTrue
=== PAUSE TestAccVPCSecurityGroup_forceRevokeRulesTrue
=== RUN   TestAccVPCSecurityGroup_forceRevokeRulesFalse
    vpc_security_group_test.go:1652: skipping long-running test in short mode
--- SKIP: TestAccVPCSecurityGroup_forceRevokeRulesFalse (0.00s)
=== RUN   TestAccVPCSecurityGroup_change
=== PAUSE TestAccVPCSecurityGroup_change
=== RUN   TestAccVPCSecurityGroup_ipv6
=== PAUSE TestAccVPCSecurityGroup_ipv6
=== RUN   TestAccVPCSecurityGroup_self
=== PAUSE TestAccVPCSecurityGroup_self
=== RUN   TestAccVPCSecurityGroup_vpc
=== PAUSE TestAccVPCSecurityGroup_vpc
=== RUN   TestAccVPCSecurityGroup_vpcNegOneIngress
=== PAUSE TestAccVPCSecurityGroup_vpcNegOneIngress
=== RUN   TestAccVPCSecurityGroup_vpcProtoNumIngress
=== PAUSE TestAccVPCSecurityGroup_vpcProtoNumIngress
=== RUN   TestAccVPCSecurityGroup_multiIngress
=== PAUSE TestAccVPCSecurityGroup_multiIngress
=== RUN   TestAccVPCSecurityGroup_vpcAllEgress
=== PAUSE TestAccVPCSecurityGroup_vpcAllEgress
=== RUN   TestAccVPCSecurityGroup_ruleDescription
=== PAUSE TestAccVPCSecurityGroup_ruleDescription
=== RUN   TestAccVPCSecurityGroup_defaultEgressVPC
=== PAUSE TestAccVPCSecurityGroup_defaultEgressVPC
=== RUN   TestAccVPCSecurityGroup_driftComplex
=== PAUSE TestAccVPCSecurityGroup_driftComplex
=== RUN   TestAccVPCSecurityGroup_invalidCIDRBlock
=== PAUSE TestAccVPCSecurityGroup_invalidCIDRBlock
=== RUN   TestAccVPCSecurityGroup_cidrAndGroups
=== PAUSE TestAccVPCSecurityGroup_cidrAndGroups
=== RUN   TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC
=== PAUSE TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC
=== RUN   TestAccVPCSecurityGroup_egressWithPrefixList
=== PAUSE TestAccVPCSecurityGroup_egressWithPrefixList
=== RUN   TestAccVPCSecurityGroup_ingressWithPrefixList
=== PAUSE TestAccVPCSecurityGroup_ingressWithPrefixList
=== RUN   TestAccVPCSecurityGroup_ipv4AndIPv6Egress
=== PAUSE TestAccVPCSecurityGroup_ipv4AndIPv6Egress
=== RUN   TestAccVPCSecurityGroup_failWithDiffMismatch
=== PAUSE TestAccVPCSecurityGroup_failWithDiffMismatch
=== RUN   TestAccVPCSecurityGroup_RuleLimit_exceededAppend
=== PAUSE TestAccVPCSecurityGroup_RuleLimit_exceededAppend
=== RUN   TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend
=== PAUSE TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend
=== RUN   TestAccVPCSecurityGroup_RuleLimit_exceededPrepend
=== PAUSE TestAccVPCSecurityGroup_RuleLimit_exceededPrepend
=== RUN   TestAccVPCSecurityGroup_RuleLimit_exceededAllNew
=== PAUSE TestAccVPCSecurityGroup_RuleLimit_exceededAllNew
=== RUN   TestAccVPCSecurityGroup_rulesDropOnError
=== PAUSE TestAccVPCSecurityGroup_rulesDropOnError
=== RUN   TestAccVPCSecurityGroup_emrDependencyViolation
    vpc_security_group_test.go:2815: skipping long-running test in short mode
--- SKIP: TestAccVPCSecurityGroup_emrDependencyViolation (0.00s)
=== CONT  TestAccVPCSecurityGroup_basic
=== CONT  TestAccVPCSecurityGroup_vpcNegOneIngress
=== CONT  TestAccVPCSecurityGroup_ingressWithPrefixList
=== CONT  TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC
=== CONT  TestAccVPCSecurityGroup_egressWithPrefixList
=== CONT  TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules
=== CONT  TestAccVPCSecurityGroup_ingressMode
=== CONT  TestAccVPCSecurityGroup_forceRevokeRulesTrue
=== CONT  TestAccVPCSecurityGroup_vpcAllEgress
=== CONT  TestAccVPCSecurityGroup_ruleGathering
=== CONT  TestAccVPCSecurityGroup_invalidCIDRBlock
=== CONT  TestAccVPCSecurityGroup_self
=== CONT  TestAccVPCSecurityGroup_RuleLimit_exceededAllNew
=== CONT  TestAccVPCSecurityGroup_RuleLimit_exceededPrepend
=== CONT  TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend
=== CONT  TestAccVPCSecurityGroup_RuleLimit_exceededAppend
=== CONT  TestAccVPCSecurityGroup_failWithDiffMismatch
=== CONT  TestAccVPCSecurityGroup_ipv4AndIPv6Egress
=== CONT  TestAccVPCSecurityGroup_defaultEgressVPC
=== CONT  TestAccVPCSecurityGroup_rulesDropOnError
--- PASS: TestAccVPCSecurityGroup_invalidCIDRBlock (10.70s)
=== CONT  TestAccVPCSecurityGroup_namePrefix
--- PASS: TestAccVPCSecurityGroup_failWithDiffMismatch (45.07s)
=== CONT  TestAccVPCSecurityGroup_sourceSecurityGroup
--- PASS: TestAccVPCSecurityGroup_vpcAllEgress (50.04s)
=== CONT  TestAccVPCSecurityGroup_allowAll
--- PASS: TestAccVPCSecurityGroup_self (51.14s)
=== CONT  TestAccVPCSecurityGroup_tags
--- PASS: TestAccVPCSecurityGroup_basic (51.17s)
=== CONT  TestAccVPCSecurityGroup_namePrefixTerraform
--- PASS: TestAccVPCSecurityGroup_defaultEgressVPC (51.23s)
=== CONT  TestAccVPCSecurityGroup_egressMode
--- PASS: TestAccVPCSecurityGroup_vpcNegOneIngress (52.35s)
=== CONT  TestAccVPCSecurityGroup_ipRangesWithSameRules
--- PASS: TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC (55.06s)
=== CONT  TestAccVPCSecurityGroup_vpc
=== CONT  TestAccVPCSecurityGroup_multiIngress
--- PASS: TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules (61.04s)
--- PASS: TestAccVPCSecurityGroup_namePrefix (52.52s)
=== CONT  TestAccVPCSecurityGroup_cidrAndGroups
--- PASS: TestAccVPCSecurityGroup_ipv4AndIPv6Egress (65.02s)
=== CONT  TestAccVPCSecurityGroup_nameGenerated
--- PASS: TestAccVPCSecurityGroup_egressWithPrefixList (68.46s)
=== CONT  TestAccVPCSecurityGroup_nameTerraformPrefix
--- PASS: TestAccVPCSecurityGroup_ingressWithPrefixList (69.53s)
=== CONT  TestAccVPCSecurityGroup_vpcProtoNumIngress
--- PASS: TestAccVPCSecurityGroup_ruleGathering (74.34s)
=== CONT  TestAccVPCSecurityGroup_ruleDescription
--- PASS: TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend (85.06s)
=== CONT  TestAccVPCSecurityGroup_driftComplex
--- PASS: TestAccVPCSecurityGroup_rulesDropOnError (85.94s)
=== CONT  TestAccVPCSecurityGroup_ipv6
--- PASS: TestAccVPCSecurityGroup_sourceSecurityGroup (50.17s)
=== CONT  TestAccVPCSecurityGroup_noVPC
--- PASS: TestAccVPCSecurityGroup_namePrefixTerraform (48.85s)
=== CONT  TestAccVPCSecurityGroup_change
--- PASS: TestAccVPCSecurityGroup_allowAll (54.06s)
=== CONT  TestAccVPCSecurityGroup_disappears
--- PASS: TestAccVPCSecurityGroup_vpc (49.34s)
--- PASS: TestAccVPCSecurityGroup_ipRangesWithSameRules (52.31s)
--- PASS: TestAccVPCSecurityGroup_ingressMode (105.09s)
--- PASS: TestAccVPCSecurityGroup_nameGenerated (45.46s)
--- PASS: TestAccVPCSecurityGroup_multiIngress (51.46s)
--- PASS: TestAccVPCSecurityGroup_cidrAndGroups (50.53s)
--- PASS: TestAccVPCSecurityGroup_nameTerraformPrefix (46.30s)
--- PASS: TestAccVPCSecurityGroup_vpcProtoNumIngress (45.64s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededAppend (129.76s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededAllNew (117.23s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededPrepend (119.88s)
--- PASS: TestAccVPCSecurityGroup_ipv6 (45.38s)
--- PASS: TestAccVPCSecurityGroup_driftComplex (48.22s)
--- PASS: TestAccVPCSecurityGroup_disappears (36.96s)
--- PASS: TestAccVPCSecurityGroup_egressMode (92.92s)
--- PASS: TestAccVPCSecurityGroup_tags (96.81s)
--- PASS: TestAccVPCSecurityGroup_change (55.16s)
--- PASS: TestAccVPCSecurityGroup_noVPC (65.25s)
--- PASS: TestAccVPCSecurityGroup_ruleDescription (86.65s)
--- PASS: TestAccVPCSecurityGroup_forceRevokeRulesTrue (240.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	256.385s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. service/vpc Issues and PRs that pertain to the vpc service. size/M Managed by automation to categorize the size of a PR. and removed documentation Introduces or discusses updates to documentation. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. service/vpc Issues and PRs that pertain to the vpc service. labels Mar 18, 2023
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. service/vpc Issues and PRs that pertain to the vpc service. labels Mar 18, 2023
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Mar 18, 2023
@github-actions github-actions bot added repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Mar 18, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

$ make ts T=TestAccVPCSecurityGroup_ PKG=vpc
==> Checking that code complies with gofmt requirements...
Running acceptance tests with -short flag
TF_ACC=1 go test ./internal/service/ec2/... -v -short -count 1 -parallel 20 -run='TestAccVPCSecurityGroup_'  -timeout 180m
--- PASS: TestAccVPCSecurityGroup_nameTerraformPrefix (35.77s)
=== CONT  TestAccVPCSecurityGroup_failWithDiffMismatch
--- PASS: TestAccVPCSecurityGroup_vpcNegOneIngress (37.40s)
=== CONT  TestAccVPCSecurityGroup_ingressWithPrefixList
--- PASS: TestAccVPCSecurityGroup_basic (37.60s)
=== CONT  TestAccVPCSecurityGroup_ipv4AndIPv6Egress
--- PASS: TestAccVPCSecurityGroup_namePrefix (37.61s)
=== CONT  TestAccVPCSecurityGroup_cidrAndGroups
--- PASS: TestAccVPCSecurityGroup_nameGenerated (38.51s)
=== CONT  TestAccVPCSecurityGroup_defaultEgressVPC
--- PASS: TestAccVPCSecurityGroup_self (38.82s)
=== CONT  TestAccVPCSecurityGroup_invalidCIDRBlock
--- PASS: TestAccVPCSecurityGroup_vpc (39.25s)
=== CONT  TestAccVPCSecurityGroup_driftComplex
--- PASS: TestAccVPCSecurityGroup_ipv6 (39.42s)
=== CONT  TestAccVPCSecurityGroup_vpcAllEgress
--- PASS: TestAccVPCSecurityGroup_allowAll (40.41s)
=== CONT  TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC
--- PASS: TestAccVPCSecurityGroup_sourceSecurityGroup (41.37s)
=== CONT  TestAccVPCSecurityGroup_multiIngress
--- PASS: TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules (43.23s)
=== CONT  TestAccVPCSecurityGroup_vpcProtoNumIngress
--- PASS: TestAccVPCSecurityGroup_invalidCIDRBlock (6.60s)
=== CONT  TestAccVPCSecurityGroup_ingressMode
--- PASS: TestAccVPCSecurityGroup_egressWithPrefixList (52.34s)
=== CONT  TestAccVPCSecurityGroup_namePrefixTerraform
--- PASS: TestAccVPCSecurityGroup_change (56.56s)
=== CONT  TestAccVPCSecurityGroup_ruleDescription
--- PASS: TestAccVPCSecurityGroup_rulesDropOnError (58.52s)
=== CONT  TestAccVPCSecurityGroup_disappears
--- PASS: TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend (61.27s)
=== CONT  TestAccVPCSecurityGroup_forceRevokeRulesTrue
--- PASS: TestAccVPCSecurityGroup_noVPC (61.45s)
=== CONT  TestAccVPCSecurityGroup_egressMode
--- PASS: TestAccVPCSecurityGroup_failWithDiffMismatch (29.26s)
=== CONT  TestAccVPCSecurityGroup_ipRangesWithSameRules
--- PASS: TestAccVPCSecurityGroup_defaultEgressVPC (32.49s)
=== CONT  TestAccVPCSecurityGroup_ruleGathering
--- PASS: TestAccVPCSecurityGroup_vpcAllEgress (33.55s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededAppend (87.20s)
--- PASS: TestAccVPCSecurityGroup_tags (75.59s)
--- PASS: TestAccVPCSecurityGroup_cidrAndGroups (38.25s)
--- PASS: TestAccVPCSecurityGroup_vpcProtoNumIngress (33.17s)
--- PASS: TestAccVPCSecurityGroup_driftComplex (37.44s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededAllNew (77.73s)
--- PASS: TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC (37.32s)
--- PASS: TestAccVPCSecurityGroup_multiIngress (36.72s)
--- PASS: TestAccVPCSecurityGroup_ipv4AndIPv6Egress (41.55s)
--- PASS: TestAccVPCSecurityGroup_RuleLimit_exceededPrepend (80.50s)
--- PASS: TestAccVPCSecurityGroup_namePrefixTerraform (28.58s)
--- PASS: TestAccVPCSecurityGroup_disappears (23.38s)
--- PASS: TestAccVPCSecurityGroup_ingressWithPrefixList (47.10s)
--- PASS: TestAccVPCSecurityGroup_ipRangesWithSameRules (26.91s)
--- PASS: TestAccVPCSecurityGroup_ingressMode (52.87s)
--- PASS: TestAccVPCSecurityGroup_ruleGathering (37.40s)
--- PASS: TestAccVPCSecurityGroup_egressMode (47.69s)
--- PASS: TestAccVPCSecurityGroup_ruleDescription (53.84s)
--- PASS: TestAccVPCSecurityGroup_forceRevokeRulesTrue (201.64s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        277.797s

GNUmakefile Outdated Show resolved Hide resolved
GNUmakefile Outdated Show resolved Hide resolved
website/docs/r/security_group.html.markdown Show resolved Hide resolved
YakDriver and others added 2 commits March 20, 2023 10:22
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
@YakDriver YakDriver merged commit ddde12c into main Mar 20, 2023
@YakDriver YakDriver deleted the b-sg-dependent-obj-retry branch March 20, 2023 17:12
@github-actions github-actions bot added this to the v4.60.0 milestone Mar 20, 2023
github-actions bot pushed a commit that referenced this pull request Mar 20, 2023
@github-actions
Copy link

This functionality has been released in v4.60.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. service/vpc Issues and PRs that pertain to the vpc service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Destroying Security Groups Takes Forever with Attached SG
2 participants