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

Add d/aws_identitystore_groups #36993

Merged

Conversation

aristosvo
Copy link
Contributor

Description

Follow-up of #31681, big thanks for @liath laying the foundation for this one.

Updated to plugin framework

Adds a data source for listing all groups in an Identity Store instance. Part of a few PRs to cover #26770.

The acceptance test is weird and I'd appreciate guidance on what to do there. The issue is that Identity Store instances are account wide so we can't guarantee there's only one group in the results or the order of the results. As far as I could find there isn't a way to say in the AttrPair checks "check these nested fields in any item of this list and compare those to these attributes on this other resource". So we're left with doing that in a custom test function.

Of course, server-side filter would likely help here but aws-sdk says that functionality is deprecated. :(

The importance of this for us a customer is mainly to automate SSO assignments within our landing zone and account vending, otherwise using scripts covering this missing functionality.

Relations

Followup of #31681
Partly closes #26770

References

@bschaatsbergen wanted to help me move this forward

Output from Acceptance Testing

% make testacc TESTS=TestAccIdentityStoreGroupsDataSource_ PKG=identitystore  
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/identitystore/... -v -count 1 -parallel 20 -run='TestAccIdentityStoreGroupsDataSource_'  -timeout 360m
=== RUN   TestAccIdentityStoreGroupsDataSource_basic
=== PAUSE TestAccIdentityStoreGroupsDataSource_basic
=== CONT  TestAccIdentityStoreGroupsDataSource_basic
--- PASS: TestAccIdentityStoreGroupsDataSource_basic (12.22s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/identitystore      16.670s

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

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • 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/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/identitystore Issues and PRs that pertain to the identitystore service. generators Relates to code generators. labels Apr 19, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 19, 2024
@aristosvo aristosvo force-pushed the f-aws_identitystore_groups-data-source branch from 8a39ce3 to c1b2c33 Compare April 19, 2024 07:23
Copy link
Member

@bschaatsbergen bschaatsbergen left a comment

Choose a reason for hiding this comment

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

Hey @aristosvo, great work! Thanks for picking this up. The PR looks really good.

Let me check with the team to see if we have an AWS account with an SSO instance set up already. Meanwhile I've left a few comments.

internal/service/identitystore/groups_data_source_test.go Outdated Show resolved Hide resolved
website/docs/d/identitystore_groups.html.markdown Outdated Show resolved Hide resolved
website/docs/d/identitystore_groups.html.markdown Outdated Show resolved Hide resolved
Copy link
Member

@bschaatsbergen bschaatsbergen left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 - looped in the AWS team internally to run the tests against an AWS account with SSO instances configured.

@ewbankkit ewbankkit added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 19, 2024
@ewbankkit ewbankkit self-assigned this Apr 19, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 19, 2024
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=TestAccIdentityStoreGroupsDataSource_' PKG=identitystore
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/identitystore/... -v -count 1 -parallel 20  -run=TestAccIdentityStoreGroupsDataSource_ -timeout 360m
=== RUN   TestAccIdentityStoreGroupsDataSource_basic
=== PAUSE TestAccIdentityStoreGroupsDataSource_basic
=== CONT  TestAccIdentityStoreGroupsDataSource_basic
--- PASS: TestAccIdentityStoreGroupsDataSource_basic (18.14s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/identitystore	29.616s

@ewbankkit
Copy link
Contributor

@aristosvo Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 44c702f into hashicorp:main Apr 19, 2024
62 checks passed
@github-actions github-actions bot added this to the v5.47.0 milestone Apr 19, 2024
@bschaatsbergen
Copy link
Member

Thanks for your contributions @aristosvo & @liath 🎉👏

@aristosvo
Copy link
Contributor Author

Thank you @bschaatsbergen for helping us push it to the finish line 🏋️🏁

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 26, 2024
Copy link

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

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 27, 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. generators Relates to code generators. new-data-source Introduces a new data source. service/identitystore Issues and PRs that pertain to the identitystore service. size/L 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.

New Datasources: aws_identitystore_users & aws_identitystore_groups (plural)
4 participants