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_ec2_network_insights_path - new resource #23330

Merged

Conversation

george-richardson
Copy link
Contributor

Adds a new resource aws_ec2_network_insights_path to partially address #16715.
Adds tests, sweeper and find functions for the new resource type.
Adds documentation for the new resource type.

Example config:

resource "aws_ec2_network_insights_path" "test" {
  source           = aws_network_interface.test.id
  destination      = aws_internet_gateway.test.id
  protocol         = "tcp"
  destination_port = 443
}

Community Note

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

Relates #16715

Output from acceptance testing:

$ make testacc TESTS=TestAccEC2NetworkInsightsPath PKG=ec2                                                                                                     
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2NetworkInsightsPath'  -timeout 180m
=== RUN   TestAccEC2NetworkInsightsPath_basic
=== PAUSE TestAccEC2NetworkInsightsPath_basic
=== RUN   TestAccEC2NetworkInsightsPath_SourceIP
=== PAUSE TestAccEC2NetworkInsightsPath_SourceIP
=== RUN   TestAccEC2NetworkInsightsPath_DestinationIP
=== PAUSE TestAccEC2NetworkInsightsPath_DestinationIP
=== RUN   TestAccEC2NetworkInsightsPath_DestinationPort
=== PAUSE TestAccEC2NetworkInsightsPath_DestinationPort
=== CONT  TestAccEC2NetworkInsightsPath_basic
=== CONT  TestAccEC2NetworkInsightsPath_DestinationIP
=== CONT  TestAccEC2NetworkInsightsPath_SourceIP
=== CONT  TestAccEC2NetworkInsightsPath_DestinationPort
--- PASS: TestAccEC2NetworkInsightsPath_basic (36.25s)
--- PASS: TestAccEC2NetworkInsightsPath_SourceIP (55.64s)
--- PASS: TestAccEC2NetworkInsightsPath_DestinationIP (58.29s)
--- PASS: TestAccEC2NetworkInsightsPath_DestinationPort (66.27s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        68.392s

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 23, 2022
@george-richardson george-richardson force-pushed the add-network-insights-path-resource branch from be9e9a4 to 0a26bcd Compare February 23, 2022 07:00
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @george-richardson 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@george-richardson george-richardson force-pushed the add-network-insights-path-resource branch 3 times, most recently from bfcffdb to d5e8433 Compare February 23, 2022 18:13
@george-richardson
Copy link
Contributor Author

I believe I have fixed all the linter checks now.

george-richardson and others added 2 commits February 24, 2022 05:50
Adds a new resource `aws_ec2_network_insights_path` to partially address 16715.
Adds tests, sweeper and find functions for the new resource type.
Adds documentation for the new resource type.
@george-richardson george-richardson force-pushed the add-network-insights-path-resource branch from d5e8433 to b510ec1 Compare February 24, 2022 05:59
@george-richardson
Copy link
Contributor Author

Rebased onto main and fixed conflicts. Fixed fmt check.

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 25, 2022
…ppears' and 'TestAccNetworkInsightsPath_tags'.
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 🚀.

Commercial
% make testacc TESTS=TestAccNetworkInsightsPath_ PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run='TestAccNetworkInsightsPath_'  -timeout 180m
=== RUN   TestAccNetworkInsightsPath_basic
=== PAUSE TestAccNetworkInsightsPath_basic
=== RUN   TestAccNetworkInsightsPath_disappears
=== PAUSE TestAccNetworkInsightsPath_disappears
=== RUN   TestAccNetworkInsightsPath_tags
=== PAUSE TestAccNetworkInsightsPath_tags
=== RUN   TestAccNetworkInsightsPath_sourceIP
=== PAUSE TestAccNetworkInsightsPath_sourceIP
=== RUN   TestAccNetworkInsightsPath_destinationIP
=== PAUSE TestAccNetworkInsightsPath_destinationIP
=== RUN   TestAccNetworkInsightsPath_destinationPort
=== PAUSE TestAccNetworkInsightsPath_destinationPort
=== CONT  TestAccNetworkInsightsPath_basic
=== CONT  TestAccNetworkInsightsPath_sourceIP
=== CONT  TestAccNetworkInsightsPath_tags
--- PASS: TestAccNetworkInsightsPath_basic (56.15s)
=== CONT  TestAccNetworkInsightsPath_destinationPort
--- PASS: TestAccNetworkInsightsPath_sourceIP (106.17s)
=== CONT  TestAccNetworkInsightsPath_destinationIP
--- PASS: TestAccNetworkInsightsPath_tags (158.94s)
=== CONT  TestAccNetworkInsightsPath_disappears
--- PASS: TestAccNetworkInsightsPath_destinationPort (117.13s)
--- PASS: TestAccNetworkInsightsPath_disappears (28.15s)
--- PASS: TestAccNetworkInsightsPath_destinationIP (90.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	200.594s
GovCloud
% make testacc TESTS=TestAccNetworkInsightsPath_ PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run='TestAccNetworkInsightsPath_'  -timeout 180m
=== RUN   TestAccNetworkInsightsPath_basic
=== PAUSE TestAccNetworkInsightsPath_basic
=== RUN   TestAccNetworkInsightsPath_disappears
=== PAUSE TestAccNetworkInsightsPath_disappears
=== RUN   TestAccNetworkInsightsPath_tags
=== PAUSE TestAccNetworkInsightsPath_tags
=== RUN   TestAccNetworkInsightsPath_sourceIP
=== PAUSE TestAccNetworkInsightsPath_sourceIP
=== RUN   TestAccNetworkInsightsPath_destinationIP
=== PAUSE TestAccNetworkInsightsPath_destinationIP
=== RUN   TestAccNetworkInsightsPath_destinationPort
=== PAUSE TestAccNetworkInsightsPath_destinationPort
=== CONT  TestAccNetworkInsightsPath_basic
=== CONT  TestAccNetworkInsightsPath_sourceIP
=== CONT  TestAccNetworkInsightsPath_destinationPort
=== CONT  TestAccNetworkInsightsPath_sourceIP
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: 0490355d-cd6d-453e-bc56-8b3c44b34bb4
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
=== CONT  TestAccNetworkInsightsPath_basic
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: 42cc78aa-3662-4f9f-83bb-60c5daaed876
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
--- SKIP: TestAccNetworkInsightsPath_sourceIP (21.99s)
=== CONT  TestAccNetworkInsightsPath_tags
=== CONT  TestAccNetworkInsightsPath_destinationPort
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: 5b695f8b-89fa-4f65-bb89-f96d4bd69977
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
--- SKIP: TestAccNetworkInsightsPath_basic (24.02s)
=== CONT  TestAccNetworkInsightsPath_disappears
--- SKIP: TestAccNetworkInsightsPath_destinationPort (27.59s)
=== CONT  TestAccNetworkInsightsPath_destinationIP
=== CONT  TestAccNetworkInsightsPath_tags
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: e5148bc2-9661-4931-ad71-c6d8ed9d38de
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
=== CONT  TestAccNetworkInsightsPath_disappears
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: 18f0a67d-9c0e-4670-8070-1ffe67604709
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
--- SKIP: TestAccNetworkInsightsPath_tags (14.70s)
=== CONT  TestAccNetworkInsightsPath_destinationIP
    acctest.go:1046: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EC2 Network Insights Path: UnsupportedOperation: The functionality you requested is not available in this region.
        	status code: 400, request id: 48cf9e50-096a-45b9-abb2-8f832e74dbb7
        
          with aws_ec2_network_insights_path.test,
          on terraform_plugin_test.tf line 35, in resource "aws_ec2_network_insights_path" "test":
          35: resource "aws_ec2_network_insights_path" "test" {
        
--- SKIP: TestAccNetworkInsightsPath_disappears (15.25s)
--- SKIP: TestAccNetworkInsightsPath_destinationIP (15.84s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	51.708s

@ewbankkit
Copy link
Contributor

@george-richardson Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 7444e9f into hashicorp:main Mar 2, 2022
@github-actions github-actions bot added this to the v4.4.0 milestone Mar 2, 2022
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

This functionality has been released in v4.4.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 May 12, 2022
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. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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.

3 participants