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

New Resource: aws_guardduty_invite_accepter #4610

Merged
merged 2 commits into from
Mar 14, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented May 22, 2018

Closes #2489

Changes proposed in this pull request:

  • Adds alternate AWS account handling in the provider acceptance testing framework
  • Adds new resource for managing a GuardDuty member account invitation from a master account and disassociation from a master account

Output from acceptance testing:

    --- PASS: TestAccAWSGuardDuty/InviteAccepter (18.16s)
        --- PASS: TestAccAWSGuardDuty/InviteAccepter/basic (18.16s)

@bflad bflad added new-resource Introduces a new resource. service/guardduty Issues and PRs that pertain to the guardduty service. labels May 22, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 22, 2018
@bflad bflad mentioned this pull request May 22, 2018
@connor-tyndall
Copy link
Contributor

connor-tyndall commented Jun 7, 2018

Are there any updates on this??

@bflad
Copy link
Contributor Author

bflad commented Jun 22, 2018

@connor-tyndall sorry for the delay with merging this resource. The work in progress note is fairly important for us to provide reliable and reproducible acceptance testing for this and other resource acceptance testing that works across multiple AWS accounts. There have been a few other priorities that have gotten in the way of focusing on finishing that up.

It'd be really helpful if folks could potentially try out a custom build of this branch and confirm it works as expected. There likely (although I can't promise) won't be any breaking changes to the resource itself to get it merged.

@bflad bflad force-pushed the f-aws_guardduty_invite_accepter branch from fe05820 to c2300ec Compare July 2, 2018 17:50
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jul 2, 2018
@brandonstevens
Copy link
Contributor

@bflad I've successfully reproduced the test results against a couple of test AWS Accounts at my disposal. I tested the original branch as well as a rebased branch (after fixing a trivial conflict). Let me know how I can further help as we're looking forward to leveraging this resource to roll out GuardDuty to our numerous accounts.

 make testacc TEST=./aws TESTARGS='-run=TestAccAWSGuardDuty/InviteAccepter'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSGuardDuty/InviteAccepter -timeout 120m
=== RUN   TestAccAWSGuardDuty
=== RUN   TestAccAWSGuardDuty/InviteAccepter
=== RUN   TestAccAWSGuardDuty/InviteAccepter/basic
--- FAIL: TestAccAWSGuardDuty (9.29s)
    --- FAIL: TestAccAWSGuardDuty/InviteAccepter (9.29s)
        --- FAIL: TestAccAWSGuardDuty/InviteAccepter/basic (9.29s)
            testing.go:538: Step 0 error: Check failed: Check 1/3 error: Not found: aws_guardduty_invite_accepter.test
            testing.go:599: Error destroying resource! WARNING: Dangling resources
                may exist. The full state and error is shown below.

                Error: config is invalid: aws_guardduty_invite_accepter.member: configuration for provider.aws.alternate is not present; a provider configuration block is required for all operations

                State: <nil>
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	9.333s
make: *** [testacc] Error 1

@bflad bflad force-pushed the f-aws_guardduty_invite_accepter branch from c2300ec to 1274a83 Compare December 4, 2018 05:29
@ghost ghost added documentation Introduces or discusses updates to documentation. size/XL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/L Managed by automation to categorize the size of a PR. labels Dec 4, 2018
@JoshiiSinfield
Copy link

Hi @bflad ,

Has there been any movement on this, & #2489 ?

Cheers,
Josh

Reference: #2489

Output from acceptance testing:

```
    --- PASS: TestAccAWSGuardDuty/InviteAccepter (18.16s)
        --- PASS: TestAccAWSGuardDuty/InviteAccepter/basic (18.16s)
```
@bflad bflad force-pushed the f-aws_guardduty_invite_accepter branch from 1274a83 to a1df6ba Compare March 8, 2019 10:54
@bflad bflad requested a review from a team March 8, 2019 10:56
@bflad bflad changed the title [WIP] New Resource: aws_guardduty_invite_accepter New Resource: aws_guardduty_invite_accepter Mar 8, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

One minor nit but otherwise good to go. Nicely Done 👍

conn := meta.(*AWSClient).guarddutyconn

detectorID := d.Get("detector_id").(string)
invitationID := ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
invitationID := ""
var invitationID string

var is preferred when declaring and initializing a variable to its zero value

@bflad bflad added this to the v2.2.0 milestone Mar 14, 2019
@bflad bflad merged commit 396b3fc into master Mar 14, 2019
@bflad bflad deleted the f-aws_guardduty_invite_accepter branch March 14, 2019 16:57
bflad added a commit that referenced this pull request Mar 14, 2019
@bflad
Copy link
Contributor Author

bflad commented Mar 15, 2019

This has been released in version 2.2.0 of the Terraform 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
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/guardduty Issues and PRs that pertain to the guardduty service. size/XL 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.

Add GuardDuty Support
5 participants