-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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_route53_resolver_rules: add new name_regex filter argument #24582
d/aws_route53_resolver_rules: add new name_regex filter argument #24582
Conversation
e661c32
to
25348bf
Compare
Acceptance tests output after force-push: ❯ make testacc TESTS=TestAccRoute53ResolverRulesDataSource PKG=route53resolver
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/route53resolver/... -v -count 1 -parallel 20 -run='TestAccRoute53ResolverRulesDataSource' -timeout 180m
=== RUN TestAccRoute53ResolverRulesDataSource_basic
=== PAUSE TestAccRoute53ResolverRulesDataSource_basic
=== RUN TestAccRoute53ResolverRulesDataSource_resolverEndpointID
=== PAUSE TestAccRoute53ResolverRulesDataSource_resolverEndpointID
=== RUN TestAccRoute53ResolverRulesDataSource_nameRegex
=== PAUSE TestAccRoute53ResolverRulesDataSource_nameRegex
=== RUN TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
=== PAUSE TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
=== CONT TestAccRoute53ResolverRulesDataSource_basic
=== CONT TestAccRoute53ResolverRulesDataSource_nameRegex
=== CONT TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
=== CONT TestAccRoute53ResolverRulesDataSource_resolverEndpointID
--- PASS: TestAccRoute53ResolverRulesDataSource_basic (7.74s)
--- PASS: TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex (8.23s)
--- PASS: TestAccRoute53ResolverRulesDataSource_nameRegex (29.64s)
--- PASS: TestAccRoute53ResolverRulesDataSource_resolverEndpointID (205.48s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver 207.060s |
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.
I believe you'd want to implement this feature as it behaves more natively with the api, by adding a filters
block argument instead of individual arguments for each filter type. Here is an example of the implementation on another data source:
"filter": DataSourceFiltersSchema(), |
Hi @drewmullen, which API are you referring to: provider's or Route53Resolver service's ? Name regex filtering isn't supported by Route53Resolver API. |
Oh jeesh. Ha - sorry about that! I just saw |
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.
Thanks for the PR, @Tailzip. It looks good, though I have a few suggestions for changes.
Co-authored-by: Graham Davison <g.m.davison@computer.org>
Thanks for the review @gdavison, I've implemented the requested changes 😄 New acceptance tests output: ❯ make testacc TESTS=TestAccRoute53ResolverRulesDataSource PKG=route53resolver
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/route53resolver/... -v -count 1 -parallel 20 -run='TestAccRoute53ResolverRulesDataSource' -timeout 180m
=== RUN TestAccRoute53ResolverRulesDataSource_basic
=== PAUSE TestAccRoute53ResolverRulesDataSource_basic
=== RUN TestAccRoute53ResolverRulesDataSource_resolverEndpointID
=== PAUSE TestAccRoute53ResolverRulesDataSource_resolverEndpointID
=== RUN TestAccRoute53ResolverRulesDataSource_nameRegex
=== PAUSE TestAccRoute53ResolverRulesDataSource_nameRegex
=== RUN TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
=== PAUSE TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
=== CONT TestAccRoute53ResolverRulesDataSource_basic
=== CONT TestAccRoute53ResolverRulesDataSource_nameRegex
=== CONT TestAccRoute53ResolverRulesDataSource_resolverEndpointID
=== CONT TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex
--- PASS: TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex (8.42s)
--- PASS: TestAccRoute53ResolverRulesDataSource_basic (8.44s)
--- PASS: TestAccRoute53ResolverRulesDataSource_nameRegex (30.37s)
--- PASS: TestAccRoute53ResolverRulesDataSource_resolverEndpointID (216.33s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver 217.901s |
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.
Thanks, @Tailzip. Looks good! 🚀
--- PASS: TestAccRoute53ResolverRulesDataSource_basic (26.38s)
--- PASS: TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex (26.69s)
--- PASS: TestAccRoute53ResolverRulesDataSource_nameRegex (49.83s)
--- PASS: TestAccRoute53ResolverRulesDataSource_resolverEndpointID (265.65s)
This functionality has been released in v4.15.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! |
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. |
Community Note
Add new
name_regex
filter argument foraws_route53_resolver_rules
datasource. Given this isn't supported natively by AWS API, filtering is performed locally after retrieving results from the API.Output from acceptance testing: