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

lakeformation_permissions: Throws "no permissions found" error if no permissions_with_grant_options property is used #19064

Closed
MitchellGerdisch opened this issue Apr 22, 2021 · 3 comments · Fixed by #18505
Assignees
Labels
bug Addresses a defect in current functionality. service/lakeformation Issues and PRs that pertain to the lakeformation service.
Milestone

Comments

@MitchellGerdisch
Copy link

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 other comments that do not add relevant new information or questions, 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 CLI and Terraform AWS Provider Version

Affected Resource(s)

  • aws_lakeformation_permissions

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

terraform {
  required_version = ">= 0.14.0"
}

provider "aws" {
  region = "us-east-1"
}

resource "aws_lakeformation_permissions" "add-pii-clientstest-tf" {
  principal   = "arn:aws:iam::xxxxxxxxx:role/xxxxxxxx"
  permissions = ["SELECT"]

  table_with_columns {
    database_name = "mydb"
    name = "mytable"
    column_names =  ["mycolumn"]
  }
}

Debug Output

Panic Output

Expected Behavior

As per the documentation, the permissions_with_grant_option is optional (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lakeformation_permissions#permissions_with_grant_option)
And creating resource without that option should work as expected.

Actual Behavior

Without that option a few things happen:

  1. This error is given: │ Error: error reading Lake Formation permissions: no permissions found
  2. But the resource is created as seen in the AWS console, for example.
  3. Any attempt to modify, refresh or destroy the resource continues to throw the error.
  4. Thus, manual deletion of the permission in AWS is required and
  5. The state file needs to be modified to get things back to a sane state.

Steps to Reproduce

  1. Create an Athena db/table
  2. Create a role.
  3. Create a lakeformation permission resource for the role on the Athena table as per the code above.
  4. terraform apply and see the error.
  5. Note that even though an error is thrown, the permission was created in AWS console.
  6. Try any other terraform command (e.g. apply, destroy, refresh) and get the error (with or without untainting).

Important Factoids

References

  • #0000
@ghost ghost added the service/lakeformation Issues and PRs that pertain to the lakeformation service. label Apr 22, 2021
@MitchellGerdisch MitchellGerdisch changed the title aws_lakeformation_permissions: Throws "no permissions found" error if no permissions_with_grant_options property is used lakeformation_permissions: Throws "no permissions found" error if no permissions_with_grant_options property is used Apr 22, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 22, 2021
@YakDriver YakDriver self-assigned this Apr 28, 2021
@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Apr 29, 2021
@YakDriver
Copy link
Member

YakDriver commented Apr 29, 2021

Additional Principals Perm Delete/Revoke
Related #16848 (Issue)
Related #16916
Related #18034 (Issue)
Related #18374
Related #17633 (Issue)
Related #18446 (Issue)
Related #18505
Related #19063 (Issue)
Related #19064 (Issue)

@ghost
Copy link

ghost commented May 7, 2021

This has been released in version 3.39.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

github-actions bot commented Jun 6, 2021

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 have found a problem that seems similar to this, 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 6, 2021
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/lakeformation Issues and PRs that pertain to the lakeformation service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants