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

r/aws_vpc_network_interface use AWS SDKv2 #32756

Merged

Conversation

mattburgess
Copy link
Collaborator

@mattburgess mattburgess commented Jul 29, 2023

Description

Relations

Relates #36219

References

Output from Acceptance Testing

$ ACCTEST_PARALLELISM=4 make testacc TESTS='TestAccVPCNetworkInterface_' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 4 -run='TestAccVPCNetworkInterface_'  -timeout 360m
=== RUN   TestAccVPCNetworkInterface_basic
=== PAUSE TestAccVPCNetworkInterface_basic
=== RUN   TestAccVPCNetworkInterface_ipv6
=== PAUSE TestAccVPCNetworkInterface_ipv6
=== RUN   TestAccVPCNetworkInterface_tags
=== PAUSE TestAccVPCNetworkInterface_tags
=== RUN   TestAccVPCNetworkInterface_ipv6Count
=== PAUSE TestAccVPCNetworkInterface_ipv6Count
=== RUN   TestAccVPCNetworkInterface_disappears
=== PAUSE TestAccVPCNetworkInterface_disappears
=== RUN   TestAccVPCNetworkInterface_description
=== PAUSE TestAccVPCNetworkInterface_description
=== RUN   TestAccVPCNetworkInterface_attachment
=== PAUSE TestAccVPCNetworkInterface_attachment
=== RUN   TestAccVPCNetworkInterface_ignoreExternalAttachment
=== PAUSE TestAccVPCNetworkInterface_ignoreExternalAttachment
=== RUN   TestAccVPCNetworkInterface_sourceDestCheck
=== PAUSE TestAccVPCNetworkInterface_sourceDestCheck
=== RUN   TestAccVPCNetworkInterface_privateIPsCount
=== PAUSE TestAccVPCNetworkInterface_privateIPsCount
=== RUN   TestAccVPCNetworkInterface_ENIInterfaceType_efa
=== PAUSE TestAccVPCNetworkInterface_ENIInterfaceType_efa
=== RUN   TestAccVPCNetworkInterface_ENI_ipv4Prefix
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv4Prefix
=== RUN   TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
=== RUN   TestAccVPCNetworkInterface_ENI_ipv6Prefix
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv6Prefix
=== RUN   TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
=== RUN   TestAccVPCNetworkInterface_privateIPSet
=== PAUSE TestAccVPCNetworkInterface_privateIPSet
=== RUN   TestAccVPCNetworkInterface_privateIPList
=== PAUSE TestAccVPCNetworkInterface_privateIPList
=== CONT  TestAccVPCNetworkInterface_basic
=== CONT  TestAccVPCNetworkInterface_privateIPsCount
=== CONT  TestAccVPCNetworkInterface_description
=== CONT  TestAccVPCNetworkInterface_ENI_ipv6Prefix
--- PASS: TestAccVPCNetworkInterface_basic (32.09s)
=== CONT  TestAccVPCNetworkInterface_privateIPList
--- PASS: TestAccVPCNetworkInterface_description (48.19s)
=== CONT  TestAccVPCNetworkInterface_privateIPSet
--- PASS: TestAccVPCNetworkInterface_ENI_ipv6Prefix (72.26s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
--- PASS: TestAccVPCNetworkInterface_privateIPsCount (82.02s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv4Prefix
--- PASS: TestAccVPCNetworkInterface_ENI_ipv4Prefix (64.84s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
--- PASS: TestAccVPCNetworkInterface_ENI_ipv6PrefixCount (87.82s)
=== CONT  TestAccVPCNetworkInterface_ipv6Count
--- PASS: TestAccVPCNetworkInterface_privateIPSet (136.42s)
=== CONT  TestAccVPCNetworkInterface_disappears
--- PASS: TestAccVPCNetworkInterface_disappears (31.55s)
=== CONT  TestAccVPCNetworkInterface_ENIInterfaceType_efa
--- PASS: TestAccVPCNetworkInterface_ENI_ipv4PrefixCount (73.61s)
=== CONT  TestAccVPCNetworkInterface_tags
--- PASS: TestAccVPCNetworkInterface_ipv6Count (82.27s)
=== CONT  TestAccVPCNetworkInterface_ignoreExternalAttachment
--- PASS: TestAccVPCNetworkInterface_ENIInterfaceType_efa (35.16s)
=== CONT  TestAccVPCNetworkInterface_sourceDestCheck
--- PASS: TestAccVPCNetworkInterface_privateIPList (225.61s)
=== CONT  TestAccVPCNetworkInterface_attachment
--- PASS: TestAccVPCNetworkInterface_tags (53.72s)
=== CONT  TestAccVPCNetworkInterface_ipv6
=== NAME  TestAccVPCNetworkInterface_ignoreExternalAttachment
    vpc_network_interface_test.go:380: Step 2/2 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
        
          map[string]string{
        + 	"attachment.#":               "1",
        + 	"attachment.0.%":             "3",
        + 	"attachment.0.attachment_id": "eni-attach-046f0e7770727fad4",
        + 	"attachment.0.device_index":  "1",
        + 	"attachment.0.instance":      "i-0089754bcae554258",
          }
--- PASS: TestAccVPCNetworkInterface_sourceDestCheck (59.35s)
--- PASS: TestAccVPCNetworkInterface_ipv6 (55.94s)
--- PASS: TestAccVPCNetworkInterface_attachment (280.40s)
=== NAME  TestAccVPCNetworkInterface_ignoreExternalAttachment
    panic.go:523: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting EC2 Network Interface (eni-0877b9cbf06df57c8): operation error EC2: DeleteNetworkInterface, https response error StatusCode: 400, RequestID: a641f72c-83fc-41da-b027-89d802530184, api error InvalidParameterValue: Network interface 'eni-0877b9cbf06df57c8' is currently in use.
        
--- FAIL: TestAccVPCNetworkInterface_ignoreExternalAttachment (325.70s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	568.160s
FAIL
make: *** [GNUmakefile:368: testacc] Error 1

@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 size/XL Managed by automation to categorize the size of a PR. service/vpc Issues and PRs that pertain to the vpc service. needs-triage Waiting for first response or review from a maintainer. and removed size/XL Managed by automation to categorize the size of a PR. labels Jul 29, 2023
@mattburgess mattburgess force-pushed the network-interface-sdkv2-migration branch from ac7a398 to 6eb6aac Compare July 29, 2023 17:06
@mattburgess mattburgess marked this pull request as ready for review July 29, 2023 17:35
@mattburgess mattburgess force-pushed the network-interface-sdkv2-migration branch from 6eb6aac to 5320c44 Compare July 29, 2023 17:59
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 31, 2023
@AdamTylerLynch
Copy link
Collaborator

@mattburgess can you provide the output of all the acceptance tests please?

@mattburgess
Copy link
Collaborator Author

Yeah, it's been a while since I touched this and I'm unlikely to get time in the near future. There's an issue with handling tags, but apart from that I think it's looking OK. Added test output to PR description.

@github-actions github-actions bot added the size/XL Managed by automation to categorize the size of a PR. label Sep 6, 2023
@mattburgess mattburgess force-pushed the network-interface-sdkv2-migration branch 3 times, most recently from 7ef5ae8 to 977f4ee Compare March 8, 2024 00:21
@mattburgess
Copy link
Collaborator Author

Rebased, fixed merge conflicts and also managed to fix the tagging issue from before. We're down to just 2 failing test cases now which I might try to take a look at tomorrow.

@mattburgess mattburgess force-pushed the network-interface-sdkv2-migration branch 6 times, most recently from efc8bb6 to d70d796 Compare March 8, 2024 20:15
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Mar 8, 2024
@mattburgess mattburgess force-pushed the network-interface-sdkv2-migration branch from d70d796 to 6291a29 Compare March 8, 2024 20:50
@mattburgess
Copy link
Collaborator Author

mattburgess commented Mar 8, 2024

@AdamTylerLynch this one's nearly ready now. Just one failing test but I can't work out what's causing the ImportStateVerify failure, unless it's a change in behaviour in the newer SDK? Hopefully you or someone else can push this one over the line? Thanks!

@mattburgess mattburgess added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label Mar 9, 2024
# Conflicts:
#	internal/service/ec2/vpc_network_interface.go
Copy link
Contributor

@ewbankkit ewbankkit 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 testacc TESTARGS='-run=TestAccVPCNetworkInterface_\|TestAccVPCNetworkInterfaceAttachment_\|TestAccVPCNetworkInterfaceDataSource_' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCNetworkInterface_\|TestAccVPCNetworkInterfaceAttachment_\|TestAccVPCNetworkInterfaceDataSource_ -timeout 360m
=== RUN   TestAccVPCNetworkInterfaceAttachment_basic
=== PAUSE TestAccVPCNetworkInterfaceAttachment_basic
=== RUN   TestAccVPCNetworkInterfaceDataSource_basic
=== PAUSE TestAccVPCNetworkInterfaceDataSource_basic
=== RUN   TestAccVPCNetworkInterfaceDataSource_filters
=== PAUSE TestAccVPCNetworkInterfaceDataSource_filters
=== RUN   TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation
=== PAUSE TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation
=== RUN   TestAccVPCNetworkInterfaceDataSource_publicIPAssociation
=== PAUSE TestAccVPCNetworkInterfaceDataSource_publicIPAssociation
=== RUN   TestAccVPCNetworkInterfaceDataSource_attachment
=== PAUSE TestAccVPCNetworkInterfaceDataSource_attachment
=== RUN   TestAccVPCNetworkInterface_basic
=== PAUSE TestAccVPCNetworkInterface_basic
=== RUN   TestAccVPCNetworkInterface_ipv6
=== PAUSE TestAccVPCNetworkInterface_ipv6
=== RUN   TestAccVPCNetworkInterface_tags
=== PAUSE TestAccVPCNetworkInterface_tags
=== RUN   TestAccVPCNetworkInterface_ipv6Count
=== PAUSE TestAccVPCNetworkInterface_ipv6Count
=== RUN   TestAccVPCNetworkInterface_disappears
=== PAUSE TestAccVPCNetworkInterface_disappears
=== RUN   TestAccVPCNetworkInterface_description
=== PAUSE TestAccVPCNetworkInterface_description
=== RUN   TestAccVPCNetworkInterface_attachment
=== PAUSE TestAccVPCNetworkInterface_attachment
=== RUN   TestAccVPCNetworkInterface_ignoreExternalAttachment
=== PAUSE TestAccVPCNetworkInterface_ignoreExternalAttachment
=== RUN   TestAccVPCNetworkInterface_sourceDestCheck
=== PAUSE TestAccVPCNetworkInterface_sourceDestCheck
=== RUN   TestAccVPCNetworkInterface_privateIPsCount
=== PAUSE TestAccVPCNetworkInterface_privateIPsCount
=== RUN   TestAccVPCNetworkInterface_ENIInterfaceType_efa
=== PAUSE TestAccVPCNetworkInterface_ENIInterfaceType_efa
=== RUN   TestAccVPCNetworkInterface_ENI_ipv4Prefix
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv4Prefix
=== RUN   TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
=== RUN   TestAccVPCNetworkInterface_ENI_ipv6Prefix
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv6Prefix
=== RUN   TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
=== PAUSE TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
=== RUN   TestAccVPCNetworkInterface_privateIPSet
=== PAUSE TestAccVPCNetworkInterface_privateIPSet
=== RUN   TestAccVPCNetworkInterface_privateIPList
=== PAUSE TestAccVPCNetworkInterface_privateIPList
=== CONT  TestAccVPCNetworkInterfaceAttachment_basic
=== CONT  TestAccVPCNetworkInterface_attachment
=== CONT  TestAccVPCNetworkInterface_privateIPList
--- PASS: TestAccVPCNetworkInterface_privateIPList (272.73s)
=== CONT  TestAccVPCNetworkInterface_privateIPSet
--- PASS: TestAccVPCNetworkInterfaceAttachment_basic (305.64s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv6PrefixCount
--- PASS: TestAccVPCNetworkInterface_attachment (356.44s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv6Prefix
--- PASS: TestAccVPCNetworkInterface_ENI_ipv6PrefixCount (102.95s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv4PrefixCount
--- PASS: TestAccVPCNetworkInterface_privateIPSet (169.25s)
=== CONT  TestAccVPCNetworkInterface_ENI_ipv4Prefix
--- PASS: TestAccVPCNetworkInterface_ENI_ipv6Prefix (88.55s)
=== CONT  TestAccVPCNetworkInterface_ENIInterfaceType_efa
--- PASS: TestAccVPCNetworkInterface_ENIInterfaceType_efa (43.42s)
=== CONT  TestAccVPCNetworkInterface_privateIPsCount
--- PASS: TestAccVPCNetworkInterface_ENI_ipv4PrefixCount (98.13s)
=== CONT  TestAccVPCNetworkInterface_sourceDestCheck
--- PASS: TestAccVPCNetworkInterface_ENI_ipv4Prefix (77.32s)
=== CONT  TestAccVPCNetworkInterface_ignoreExternalAttachment
--- PASS: TestAccVPCNetworkInterface_sourceDestCheck (86.64s)
=== CONT  TestAccVPCNetworkInterface_basic
--- PASS: TestAccVPCNetworkInterface_privateIPsCount (105.62s)
=== CONT  TestAccVPCNetworkInterface_description
--- PASS: TestAccVPCNetworkInterface_basic (41.32s)
=== CONT  TestAccVPCNetworkInterface_disappears
--- PASS: TestAccVPCNetworkInterface_description (59.28s)
=== CONT  TestAccVPCNetworkInterface_ipv6Count
=== NAME  TestAccVPCNetworkInterface_ignoreExternalAttachment
    vpc_network_interface_test.go:355: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting EC2 Network Interface (eni-07b5d49e8c40a3e50): operation error EC2: DeleteNetworkInterface, https response error StatusCode: 400, RequestID: 703e6f71-398d-47ba-8d52-06e503a2fc97, api error InvalidParameterValue: Network interface 'eni-07b5d49e8c40a3e50' is currently in use.
        
--- FAIL: TestAccVPCNetworkInterface_ignoreExternalAttachment (136.35s)
=== CONT  TestAccVPCNetworkInterface_tags
--- PASS: TestAccVPCNetworkInterface_disappears (37.24s)
=== CONT  TestAccVPCNetworkInterface_ipv6
--- PASS: TestAccVPCNetworkInterface_tags (77.82s)
=== CONT  TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation
--- PASS: TestAccVPCNetworkInterface_ipv6 (87.21s)
=== CONT  TestAccVPCNetworkInterfaceDataSource_attachment
--- PASS: TestAccVPCNetworkInterface_ipv6Count (105.89s)
=== CONT  TestAccVPCNetworkInterfaceDataSource_publicIPAssociation
--- PASS: TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation (30.94s)
=== CONT  TestAccVPCNetworkInterfaceDataSource_filters
--- PASS: TestAccVPCNetworkInterfaceDataSource_publicIPAssociation (29.61s)
=== CONT  TestAccVPCNetworkInterfaceDataSource_basic
--- PASS: TestAccVPCNetworkInterfaceDataSource_filters (26.44s)
--- PASS: TestAccVPCNetworkInterfaceDataSource_basic (25.06s)
--- PASS: TestAccVPCNetworkInterfaceDataSource_attachment (289.36s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1060.946s
FAIL
make: *** [testacc] Error 1

Failure is unrelated to this change and is occurring in CI.

% make testacc TESTARGS='-run=TestAccELBLoadBalancer_basic' PKG=elb ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/elb/... -v -count 1 -parallel 3  -run=TestAccELBLoadBalancer_basic -timeout 360m
=== RUN   TestAccELBLoadBalancer_basic
=== PAUSE TestAccELBLoadBalancer_basic
=== CONT  TestAccELBLoadBalancer_basic
--- PASS: TestAccELBLoadBalancer_basic (29.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elb	43.791s
% make testacc TESTARGS='-run=TestAccELBV2LoadBalancer_ALB_basic' PKG=elbv2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/elbv2/... -v -count 1 -parallel 3  -run=TestAccELBV2LoadBalancer_ALB_basic -timeout 360m
=== RUN   TestAccELBV2LoadBalancer_ALB_basic
=== PAUSE TestAccELBV2LoadBalancer_ALB_basic
=== CONT  TestAccELBV2LoadBalancer_ALB_basic
--- PASS: TestAccELBV2LoadBalancer_ALB_basic (218.54s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elbv2	229.778s

@ewbankkit ewbankkit added technical-debt Addresses areas of the codebase that need refactoring or redesign. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Apr 16, 2024
@ewbankkit ewbankkit merged commit 81ea9bb into hashicorp:main Apr 17, 2024
45 checks passed
@github-actions github-actions bot added this to the v5.46.0 milestone Apr 17, 2024
Copy link

This functionality has been released in v5.46.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!

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 May 20, 2024
@justinretzolk justinretzolk added the external-maintainer Contribution from a trusted external contributor. label Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. external-maintainer Contribution from a trusted external contributor. service/vpc Issues and PRs that pertain to the vpc service. size/XL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

4 participants