-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Support for GuardDuty Member Detector Features #35625
Support for GuardDuty Member Detector Features #35625
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.
Welcome @autero1 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Oh... looks like I should've read this first: #32917 |
Thank you for your contribution! 🚀 Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the Additional details:
|
Output from acc tests after refactor:
|
Seeing some traction on this issue would be greatly appreciated, I have some accounts where we'd prefer guard duty not to inspect the s3 logs, while for others this is needed and to be able to control it via terrafrom would be great |
Happy to finish this up. Don't really know if something is expected of me or is it just queued for approval. |
# Conflicts: # internal/service/guardduty/service_endpoints_gen_test.go # names/data/names_data.csv
@ewbankkit would you have time to review this change? |
# Conflicts: # internal/conns/awsclient_gen.go # internal/service/guardduty/service_endpoints_gen_test.go # internal/service/guardduty/service_package_gen.go # names/data/names_data.csv
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 🚀.
% AWS_GUARDDUTY_MEMBER_ACCOUNT_ID=123456789012 make testacc TESTARGS='-run=TestAccGuardDuty_serial/^MemberDetectorFeature$$' PKG=guardduty
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/guardduty/... -v -count 1 -parallel 20 -run=TestAccGuardDuty_serial/^MemberDetectorFeature$ -timeout 360m -vet=off
2025/01/30 10:56:27 Initializing Terraform AWS Provider...
=== RUN TestAccGuardDuty_serial
=== PAUSE TestAccGuardDuty_serial
=== CONT TestAccGuardDuty_serial
=== RUN TestAccGuardDuty_serial/MemberDetectorFeature
=== RUN TestAccGuardDuty_serial/MemberDetectorFeature/basic
=== RUN TestAccGuardDuty_serial/MemberDetectorFeature/additional_configuration
=== RUN TestAccGuardDuty_serial/MemberDetectorFeature/multiple
--- PASS: TestAccGuardDuty_serial (46.66s)
--- PASS: TestAccGuardDuty_serial/MemberDetectorFeature (46.66s)
--- PASS: TestAccGuardDuty_serial/MemberDetectorFeature/basic (22.11s)
--- PASS: TestAccGuardDuty_serial/MemberDetectorFeature/additional_configuration (11.61s)
--- PASS: TestAccGuardDuty_serial/MemberDetectorFeature/multiple (12.94s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/guardduty 52.202s
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 🚀
@autero1 Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.85.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. |
Description
This PR adds support for configuring AWS GuardDuty Member Detector Features, e.g.
Gotchas
Deleting the resource
When deleted (as many other existing GuarDuty Org features, such as guardduty_organization_configuration_feature), just removes the resource from state without disabling the resource.
Eventual consistency
When you use
aws_guardduty_organization_configuration
and setauto_enable_organization_members = "ALL"
and try to use the resource for configuring member features, you keep hitting this:This is likely due to eventual consistency with the member accounts. My original test strategy was exactly this, but I just gave up. This definitely has serious implications on the usability as you most likely would use these resources together. Ended up testing with a prepared env where you already have an existing member account.
Random order of additional configuration
I keep hitting an issue where the API returns the additional configuration in random order and you get a perpetual diff - causing test failures and general annoyance 😅 . This is why the tests have some checks disabled atm.
Relations
Closes #26168
References
https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html
Output from Acceptance Testing