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 quicksight group membership resource #20687

Merged

Conversation

lacernetic
Copy link
Contributor

@lacernetic lacernetic commented Aug 25, 2021

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

NOTE: This code is an updated version of issue #11160 created by @mjgpy3. Due to his absence I will take up role in changing it according to the code review.

Relates #10990
Closes #11160
Closes #16609

Output from acceptance testing:

make testacc TESTARGS='-run=TestAccAWSQuickSightGroupMembership'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSQuickSightGroupMembership -timeout 180m
=== RUN   TestAccAWSQuickSightGroupMembership_basic
=== PAUSE TestAccAWSQuickSightGroupMembership_basic
=== RUN   TestAccAWSQuickSightGroupMembership_disappears
=== PAUSE TestAccAWSQuickSightGroupMembership_disappears
=== CONT  TestAccAWSQuickSightGroupMembership_basic
=== CONT  TestAccAWSQuickSightGroupMembership_disappears
--- PASS: TestAccAWSQuickSightGroupMembership_disappears (29.77s)
--- PASS: TestAccAWSQuickSightGroupMembership_basic (33.91s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	36.954s
$ make testacc TESTARGS='-run=TestAccAWSQuickSightGroupMembership'

...

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/quicksight Issues and PRs that pertain to the quicksight service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Aug 25, 2021
@github-actions
Copy link

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 go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @lacernetic 👋

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 CONTRIBUTING 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! 😃

@breathingdust breathingdust added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 26, 2021
…uses aws.stringvalue() to dereference, docs now uses terraform block
@anGie44 anGie44 self-assigned this Aug 31, 2021
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Hi @lacernetic, thank you again for submitting this PR! I've left comments below for your review. Reach out if anything!

aws/resource_aws_quicksight_group_membership.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership.go Outdated Show resolved Hide resolved
website/docs/r/quicksight_group_membership.html.markdown Outdated Show resolved Hide resolved
website/docs/r/quicksight_group_membership.html.markdown Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership_test.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership_test.go Outdated Show resolved Hide resolved
aws/resource_aws_quicksight_group_membership_test.go Outdated Show resolved Hide resolved
@lacernetic
Copy link
Contributor Author

@anGie44 I made all the changes you requested but I did have a hiccup when it comes to testing using my finder function. It works upon creation and when checking for disappears, however in the test for existence it fails with this error:

testing_new.go:70: Error running post-test destroy, there may be dangling resources: ResourceNotFoundException: Group tf-acc-test-951261255642225215 does not exist in the namespace default of account 679918515340. AWS account id: 679918515340, Namespace: default, groupName: tf-acc-test-951261255642225215 { RespMetadata: { StatusCode: 404, RequestID: "cabed1d2-8d04-4138-b866-824705c50cf1" }, Message_: "Group tf-acc-test-951261255642225215 does not exist in the namespace default of account 679918515340. AWS account id: 679918515340, Namespace: default, groupName: tf-acc-test-951261255642225215", RequestId: "cabed1d2-8d04-4138-b866-824705c50cf1", ResourceType: "GROUP" } --- FAIL: TestAccAWSQuickSightGroupMembership_basic (40.13s) FAIL FAIL github.com/terraform-providers/terraform-provider-aws/aws 44.726s FAIL

I did some debugging and saw that it's correct that the group no longer exists. I'm not sure why anything is getting deleted during an exist check, and was hoping you might have an idea on what might be going on here.

Previously this function would check to see if the group exists, not the group membership (which felt weird to me). Maybe the problem could be something to do with that as well?

@anGie44
Copy link
Contributor

anGie44 commented Sep 7, 2021

@lacernetic Ah ok no worries! looks like we just need to catch that error in testAccCheckQuickSightGroupMembershipDestroy similar to testAccCheckQuickSightUserDestroy in resource_aws_quicksight_user_test.go

I believe what is happening is that by the time found, err := finder.GroupMembership(conn, listInput, userName) is run inside of testAccCheckQuickSightGroupMembershipDestroy, all terraform resources have already been deleted, so the group membership call will correctly error out, which is normal behavior

… message to be more verbose, deleted testacccheckquicksightgroupmembershipdisappears, removed useless comments, changed state to state context
@anGie44
Copy link
Contributor

anGie44 commented Sep 7, 2021

@lacernetic , thanks for the changes! and don't worry about the failing CI check -- we've noticed it's occurring in main

@anGie44 anGie44 added this to the v3.58.0 milestone Sep 7, 2021
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Thanks again @lacernetic , LGTM 🚀

Output of acceptance tests:

--- PASS: TestAccAWSQuickSightGroupMembership_disappears (18.86s)
--- PASS: TestAccAWSQuickSightGroupMembership_basic (21.94s)

@anGie44 anGie44 merged commit 4a5c16e into hashicorp:main Sep 7, 2021
@lacernetic lacernetic deleted the f_quicksight_group_membership_resource branch September 7, 2021 22:14
@github-actions
Copy link

github-actions bot commented Sep 9, 2021

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

This was referenced Sep 30, 2021
@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, 2022
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/quicksight Issues and PRs that pertain to the quicksight 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.

QuickSight group membership
3 participants