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

d/aws_vpc_endpoint: Add support for tag filters #10503

Merged
merged 1 commit into from
Nov 2, 2019

Conversation

ewbankkit
Copy link
Contributor

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #10465.

Release note for CHANGELOG:

data-source/aws_vpc_endpoint: Add `filter` attribute and support for filtering by `tags`

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAwsVpcEndpoint_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== RUN   TestAccDataSourceAwsVpcEndpoint_byId
=== PAUSE TestAccDataSourceAwsVpcEndpoint_byId
=== RUN   TestAccDataSourceAwsVpcEndpoint_byFilter
=== PAUSE TestAccDataSourceAwsVpcEndpoint_byFilter
=== RUN   TestAccDataSourceAwsVpcEndpoint_byTags
=== PAUSE TestAccDataSourceAwsVpcEndpoint_byTags
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags
=== RUN   TestAccDataSourceAwsVpcEndpoint_interface
=== PAUSE TestAccDataSourceAwsVpcEndpoint_interface
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== CONT  TestAccDataSourceAwsVpcEndpoint_interface
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags
=== CONT  TestAccDataSourceAwsVpcEndpoint_byTags
=== CONT  TestAccDataSourceAwsVpcEndpoint_byFilter
=== CONT  TestAccDataSourceAwsVpcEndpoint_byId
--- PASS: TestAccDataSourceAwsVpcEndpoint_byFilter (46.98s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (47.24s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_byId (47.37s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_byTags (47.94s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags (52.93s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_interface (188.69s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	188.724s

@ewbankkit ewbankkit requested a review from a team October 14, 2019 18:31
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Oct 14, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 2, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good with one non-blocking nit for the future, thanks @ewbankkit 🚀

--- PASS: TestAccDataSourceAwsVpcEndpoint_byId (23.79s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_byTags (23.86s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_byFilter (23.94s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (23.95s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags (24.23s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_interface (139.87s)

{
Config: testAccDataSourceAwsVpcEndpointConfig_byFilter(rName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(datasourceName, "vpc_endpoint_type", "Gateway"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Data source testing is easier with resource.TestCheckResourceAttrPair() so you don't need to know the exact details of the resource you're matching while still verifying it matches the expected values 👍 , e.g.

resource.TestCheckResourceAttrPair(datasourceName, "vpc_endpoint_type", resourceName, "vpc_endpoint_type"),

@bflad bflad added this to the v2.35.0 milestone Nov 2, 2019
@bflad bflad merged commit c4c1765 into hashicorp:master Nov 2, 2019
bflad added a commit that referenced this pull request Nov 2, 2019
@ewbankkit ewbankkit deleted the issue-10465 branch November 4, 2019 22:31
@ghost
Copy link

ghost commented Nov 7, 2019

This has been released in version 2.35.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
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. service/ec2 Issues and PRs that pertain to the ec2 service. size/M 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.

tag support in vpc_endpoint datasource
2 participants