-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
f-aws_ec2_traffic_mirror_target #26864
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this 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!
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
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), |
There was a problem hiding this comment.
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
//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"), |
There was a problem hiding this comment.
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
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"), |
@GlennChia Thanks for the review. The PR is now set. Here are the acceptance test results. |
Acceptance Results: |
bfb85a0
to
6a8cee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @meetreks, approved!
…in acceptance test configurations.
There was a problem hiding this 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
@meetreks Thanks for the contribution 🎉 👏. |
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! |
Thanks @ewbankkit looked at your commit and it made sense to me with the changes. |
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. |
Relates to #26767
Output from acceptance testing: