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

f-aws_ec2_traffic_mirror_target #26864

Merged
merged 6 commits into from
Sep 29, 2022

Conversation

meetreks
Copy link
Contributor

@meetreks meetreks commented Sep 19, 2022

Relates to #26767

Output from acceptance testing:

$ make testacc PKG=ec2 TESTS=TestAccVPCTrafficMirrorTarget_gwlb
~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $ make testacc PKG=ec2 TESTS=TestAccVPCTrafficMirrorTarget_gwlb
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCTrafficMirrorTarget_gwlb'  -timeout 180m
=== RUN   TestAccVPCTrafficMirrorTarget_gwlb
=== PAUSE TestAccVPCTrafficMirrorTarget_gwlb
=== CONT  TestAccVPCTrafficMirrorTarget_gwlb
--- PASS: TestAccVPCTrafficMirrorTarget_gwlb (258.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        258.244s
:~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $ 
:~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $ 
...

@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

  • Please review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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/M 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. service/vpc Issues and PRs that pertain to the vpc service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 19, 2022
Copy link
Collaborator

@GlennChia GlennChia left a comment

Choose a reason for hiding this comment

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

PR looks good @meetreks! Small changes requested to improve the docs and test. Once the test cases are run, the PR description above should also be updated with the results. Thanks!

website/docs/r/ec2_traffic_mirror_target.html.markdown Outdated Show resolved Hide resolved
internal/service/ec2/vpc_traffic_mirror_target_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@GlennChia GlennChia left a comment

Choose a reason for hiding this comment

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

After discussion, gateway_load_balancer_endpoint_id does not use the Load Balancer's ID. Rather it is the VPCE ID. We can also call this out in the documentation


resource "aws_ec2_traffic_mirror_target" "gwlb" {
description = "GWLB target"
gateway_load_balancer_endpoint_id = aws_lb.gwlb.arn
Copy link
Collaborator

Choose a reason for hiding this comment

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

On further inspection, this accepts a VPC Endpoint ID and not the Load Balancer ARN. Will this change be better

Suggested change
gateway_load_balancer_endpoint_id = aws_lb.gwlb.arn
gateway_load_balancer_endpoint_id = aws_vpc_endpoint.example.id

@@ -332,6 +363,19 @@ resource "aws_ec2_traffic_mirror_target" "test" {
`, rName, description, tagKey1, tagValue1, tagKey2, tagValue2))
}

func testAccVPCTrafficMirrorTargetConfig_gwlb(rName, description string) string {
return acctest.ConfigCompose(
//testAccTrafficMirrorTargetConfigBase(rName),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can remove this unused comment as well

Suggested change
//testAccTrafficMirrorTargetConfigBase(rName),

Config: testAccVPCTrafficMirrorTargetConfig_gwlb(rName, description),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "description", description),
resource.TestCheckResourceAttrPair(resourceName, "gateway_load_balancer_endpoint_id", "aws_lb.test", "id"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Changing aws_lb to aws_vpc_endpoint

Suggested change
resource.TestCheckResourceAttrPair(resourceName, "gateway_load_balancer_endpoint_id", "aws_lb.test", "id"),
resource.TestCheckResourceAttrPair(resourceName, "gateway_load_balancer_endpoint_id", "aws_vpc_endpoint.test", "id"),

@meetreks
Copy link
Contributor Author

@GlennChia Thanks for the review. The PR is now set. Here are the acceptance test results.

@meetreks
Copy link
Contributor Author

Acceptance Results: ~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $ make testacc PKG=ec2 TESTS=TestAccVPCTrafficMirrorTarget_gwlb ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCTrafficMirrorTarget_gwlb' -timeout 180m === RUN TestAccVPCTrafficMirrorTarget_gwlb === PAUSE TestAccVPCTrafficMirrorTarget_gwlb === CONT TestAccVPCTrafficMirrorTarget_gwlb --- PASS: TestAccVPCTrafficMirrorTarget_gwlb (258.16s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 258.244s :~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $ :~/terraform-provider-aws (f-aws_ec2_traffic_mirror_target) $

@meetreks meetreks force-pushed the f-aws_ec2_traffic_mirror_target branch from bfb85a0 to 6a8cee0 Compare September 22, 2022 18:33
Copy link
Collaborator

@GlennChia GlennChia left a comment

Choose a reason for hiding this comment

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

LGTM @meetreks, approved!

@ewbankkit ewbankkit 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 Sep 28, 2022
@github-actions github-actions bot added size/XL 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 Sep 29, 2022
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=TestAccVPCTrafficMirrorTarget_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCTrafficMirrorTarget_ -timeout 180m
=== RUN   TestAccVPCTrafficMirrorTarget_nlb
=== PAUSE TestAccVPCTrafficMirrorTarget_nlb
=== RUN   TestAccVPCTrafficMirrorTarget_eni
=== PAUSE TestAccVPCTrafficMirrorTarget_eni
=== RUN   TestAccVPCTrafficMirrorTarget_tags
=== PAUSE TestAccVPCTrafficMirrorTarget_tags
=== RUN   TestAccVPCTrafficMirrorTarget_disappears
=== PAUSE TestAccVPCTrafficMirrorTarget_disappears
=== RUN   TestAccVPCTrafficMirrorTarget_gwlb
=== PAUSE TestAccVPCTrafficMirrorTarget_gwlb
=== CONT  TestAccVPCTrafficMirrorTarget_nlb
=== CONT  TestAccVPCTrafficMirrorTarget_disappears
--- PASS: TestAccVPCTrafficMirrorTarget_disappears (223.78s)
=== CONT  TestAccVPCTrafficMirrorTarget_tags
--- PASS: TestAccVPCTrafficMirrorTarget_nlb (236.39s)
=== CONT  TestAccVPCTrafficMirrorTarget_eni
--- PASS: TestAccVPCTrafficMirrorTarget_eni (115.80s)
=== CONT  TestAccVPCTrafficMirrorTarget_gwlb
--- PASS: TestAccVPCTrafficMirrorTarget_tags (245.64s)
--- PASS: TestAccVPCTrafficMirrorTarget_gwlb (373.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	729.696s

@ewbankkit
Copy link
Contributor

@meetreks Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 9c21d5d into hashicorp:main Sep 29, 2022
@github-actions github-actions bot added this to the v4.33.0 milestone Sep 29, 2022
@meetreks meetreks deleted the f-aws_ec2_traffic_mirror_target branch September 29, 2022 17:10
@github-actions
Copy link

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

@meetreks
Copy link
Contributor Author

Thanks @ewbankkit looked at your commit and it made sense to me with the changes.

@github-actions
Copy link

github-actions bot commented Nov 1, 2022

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 Nov 1, 2022
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
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. enhancement Requests to existing resources that expand the functionality or scope. partner Contribution from a partner. service/vpc Issues and PRs that pertain to the vpc service. size/XL 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.

4 participants