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

aws_guardduty_detector attempts to modify settings when account is a member (vs master) #7781

Closed
lorengordon opened this issue Mar 1, 2019 · 5 comments · Fixed by #7804
Closed
Labels
bug Addresses a defect in current functionality. service/guardduty Issues and PRs that pertain to the guardduty service.
Milestone

Comments

@lorengordon
Copy link
Contributor

lorengordon commented Mar 1, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • Terraform v0.11.11

Affected Resource(s)

  • aws_guardduty_detector

Terraform Configuration Files

resource "aws_guardduty_detector" "member" {
  enable = true
}

Expected Behavior

Terraform should not attempt to (re)set values that are not specified in the config

Actual Behavior

Because the Guard Duty master account has modified the default finding publishing frequency, terraform detects a difference in the member account config and attempts to change it. This is disallowed, because member accounts cannot change managed settings.

Steps to Reproduce

  1. terraform apply
  2. Invite/accept the account so it becomes a member of another account's Guard Duty
  3. Modify the finding publishing in the master account
  4. terraform apply
module.guardduty_member.aws_guardduty_detector.member: Modifying... (ID: XXX)
  finding_publishing_frequency: "ONE_HOUR" => "SIX_HOURS"

Error: Error applying plan:

1 error(s) occurred:

* aws_guardduty_detector.member: 1 error(s) occurred:

* aws_guardduty_detector.member: Updating GuardDuty Detector 'XXX' failed: BadRequestException: The request is rejected because member accounts cannot manage specified resources or properties.
        status code: 400, request id: 17e233d2-3c19-11e9-b1ca-17c471a03d83
@bflad bflad added bug Addresses a defect in current functionality. service/guardduty Issues and PRs that pertain to the guardduty service. labels Mar 1, 2019
@bflad
Copy link
Contributor

bflad commented Mar 1, 2019

Hi @lorengordon 👋 Thanks for reporting this, good find.

We'll likely need to mark that schema attribute as Computed: true with two comments in the resource documentation that it must be configured to detect drift in master accounts and that it should not be specified in member accounts.

bflad added a commit that referenced this issue Mar 4, 2019
… usage for member accounts

Reference:
* #7781

Output from acceptance testing:

```
    --- PASS: TestAccAWSGuardDuty/Detector (36.21s)
        --- PASS: TestAccAWSGuardDuty/Detector/basic (25.70s)
        --- PASS: TestAccAWSGuardDuty/Detector/import (10.50s)
```
@bflad
Copy link
Contributor

bflad commented Mar 4, 2019

Pull request submitted: #7804

@bflad bflad added this to the v2.1.0 milestone Mar 4, 2019
@bflad
Copy link
Contributor

bflad commented Mar 4, 2019

The fix for this has been merged and will release with version 2.1.0 of the Terraform AWS Provider, likely middle of this week.

@bflad
Copy link
Contributor

bflad commented Mar 8, 2019

This has been released in version 2.1.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 31, 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 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/guardduty Issues and PRs that pertain to the guardduty service.
Projects
None yet
2 participants