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 for Macie2 Member and Invitation Accepter #19304

Merged
merged 18 commits into from
May 17, 2021

Conversation

coderGo93
Copy link
Contributor

@coderGo93 coderGo93 commented May 10, 2021

  • Added a new resource, docs and tests for Macie Member called aws_macie2_member with the workflow of Invitation
  • Added a new resource, docs and tests for Macie Invitation Accepter called aws_macie2_invitation_accepter

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13432

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSMacie2_serial/Member'            
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSMacie2_serial/Member -timeout 180m
=== RUN   TestAccAWSMacie2_serial
=== RUN   TestAccAWSMacie2_serial/Member
=== RUN   TestAccAWSMacie2_serial/Member/basic
=== RUN   TestAccAWSMacie2_serial/Member/disappears
=== RUN   TestAccAWSMacie2_serial/Member/tags
=== RUN   TestAccAWSMacie2_serial/Member/invite
=== RUN   TestAccAWSMacie2_serial/Member/invite_removed
=== RUN   TestAccAWSMacie2_serial/Member/status
--- PASS: TestAccAWSMacie2_serial (221.91s)
    --- PASS: TestAccAWSMacie2_serial/Member (221.91s)
        --- PASS: TestAccAWSMacie2_serial/Member/basic (28.34s)
        --- PASS: TestAccAWSMacie2_serial/Member/disappears (22.17s)
        --- PASS: TestAccAWSMacie2_serial/Member/tags (25.88s)
        --- PASS: TestAccAWSMacie2_serial/Member/invite (46.95s)
        --- PASS: TestAccAWSMacie2_serial/Member/invite_removed (47.64s)
        --- PASS: TestAccAWSMacie2_serial/Member/status (50.94s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       221.964s

...
$   make testacc TESTARGS='-run=TestAccAWSMacie2_serial/InvitationAccepter'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSMacie2_serial/InvitationAccepter -timeout 180m
=== RUN   TestAccAWSMacie2_serial
=== RUN   TestAccAWSMacie2_serial/InvitationAccepter
=== RUN   TestAccAWSMacie2_serial/InvitationAccepter/basic
--- PASS: TestAccAWSMacie2_serial (34.45s)
    --- PASS: TestAccAWSMacie2_serial/InvitationAccepter (34.45s)
        --- PASS: TestAccAWSMacie2_serial/InvitationAccepter/basic (34.45s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       34.511s

...

@coderGo93 coderGo93 requested a review from a team as a code owner May 10, 2021 23:31
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/macie2 Issues and PRs that pertain to the macie2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 10, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 10, 2021
@gdavison gdavison removed the needs-triage Waiting for first response or review from a maintainer. label May 11, 2021
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

A number of changes for cross-account testing, error handling, and creating invitations

aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Show resolved Hide resolved
aws/resource_aws_macie2_invitation_accepter_test.go Outdated Show resolved Hide resolved
website/docs/r/macie2_invitation.html.markdown Outdated Show resolved Hide resolved
website/docs/r/macie2_member.html.markdown Outdated Show resolved Hide resolved
website/docs/r/macie2_member.html.markdown Outdated Show resolved Hide resolved
@coderGo93 coderGo93 requested a review from gdavison May 11, 2021 23:19
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

The waiter looks good. Some changes to the tests and some minor stylistic changes.

aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
website/docs/r/macie2_invitation.html.markdown Outdated Show resolved Hide resolved
website/docs/r/macie2_invitation_accepter.html.markdown Outdated Show resolved Hide resolved
aws/internal/service/macie2/waiter/waiter.go Outdated Show resolved Hide resolved
aws/internal/service/macie2/waiter/status.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/internal/service/macie2/waiter/status.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Show resolved Hide resolved
@coderGo93 coderGo93 requested a review from gdavison May 13, 2021 01:01
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

A number of updates to the tests and a few other tweaks

aws/internal/service/macie2/finder/finder.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation_test.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation_accepter_test.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_invitation_accepter_test.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Outdated Show resolved Hide resolved
@coderGo93 coderGo93 requested a review from gdavison May 14, 2021 00:35
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

A few more tweaks to make. It's almost there!

aws/resource_aws_macie2_member.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member.go Outdated Show resolved Hide resolved
aws/resource_aws_macie2_member.go Show resolved Hide resolved
aws/resource_aws_macie2_member_test.go Show resolved Hide resolved
website/docs/r/macie2_invitation_accepter.html.markdown Outdated Show resolved Hide resolved
@coderGo93 coderGo93 changed the title New resource for Macie2 Member, Invitation and Invitation Accepter New resource for Macie2 Member and Invitation Accepter May 15, 2021
@coderGo93 coderGo93 requested a review from gdavison May 15, 2021 02:22
Copy link
Contributor

@gdavison gdavison 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, then we're good to merge

aws/provider.go Outdated
Comment on lines 849 to 851
"aws_macie2_organization_admin_account": resourceAwsMacie2OrganizationAdminAccount(),
"aws_macie2_invitation_accepter": resourceAwsMacie2InvitationAccepter(),
"aws_macie2_member": resourceAwsMacie2Member(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: These should be sorted alphabetically

@coderGo93 coderGo93 requested a review from gdavison May 17, 2021 18:29
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

--- PASS: TestAccAWSMacie2_serial (444.37s)
--- PASS: TestAccAWSMacie2_serial/Member (387.34s)
--- PASS: TestAccAWSMacie2_serial/Member/invite (84.97s)
--- PASS: TestAccAWSMacie2_serial/Member/invite_removed (82.14s)
--- PASS: TestAccAWSMacie2_serial/Member/status (81.87s)
--- PASS: TestAccAWSMacie2_serial/Member/basic (46.70s)
--- PASS: TestAccAWSMacie2_serial/Member/disappears (42.34s)
--- PASS: TestAccAWSMacie2_serial/Member/tags (49.30s)
--- PASS: TestAccAWSMacie2_serial/InvitationAccepter (57.03s)
--- PASS: TestAccAWSMacie2_serial/InvitationAccepter/basic (57.03s)

@gdavison gdavison merged commit 761addd into hashicorp:main May 17, 2021
@github-actions github-actions bot added this to the v3.41.0 milestone May 17, 2021
@ghost
Copy link

ghost commented May 19, 2021

This has been released in version 3.41.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 for triage. Thanks!

@github-actions
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 Jun 18, 2021
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/macie2 Issues and PRs that pertain to the macie2 service. size/XXL 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.

Feature Request: Amazon Macie2 Support
2 participants