-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
bugfix: Lake Formation permissions/permissions_with_grant_option type #38047
bugfix: Lake Formation permissions/permissions_with_grant_option type #38047
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @diofeher 👋
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 CONTRIBUTOR 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! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
% make testacc TESTARGS="-run=TestAccLakeFormation_serial/PermissionsBasic/\|TestAccLakeFormation_serial/PermissionsTableWithColumns/" PKG=lakeformation
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lakeformation/... -v -count 1 -parallel 20 -run=TestAccLakeFormation_serial/PermissionsBasic/\|TestAccLakeFormation_serial/PermissionsTableWithColumns/ -timeout 360m
2024/12/12 16:04:41 Initializing Terraform AWS Provider...
--- PASS: TestAccLakeFormation_serial (435.92s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns (131.88s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardExcludedColumns (23.02s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectOnly (22.00s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectPlus (18.57s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/basic (47.03s)
--- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/implicit (21.26s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic (304.03s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/basic (23.03s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/database (21.22s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseMultiple (21.24s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/dataLocation (23.03s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTagPolicy (20.53s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseIAMAllowed (43.52s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/dataCellsFilter (23.68s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/disappears (84.38s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTag (21.53s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTagPolicyMultiple (21.87s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation 442.222s
% make testacc TESTARGS="-run=TestAccLakeFormation_serial/PermissionsDataSource/" PKG=lakeformation
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lakeformation/... -v -count 1 -parallel 20 -run=TestAccLakeFormation_serial/PermissionsDataSource/ -timeout 360m
2024/12/12 16:26:23 Initializing Terraform AWS Provider...
--- PASS: TestAccLakeFormation_serial (184.87s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource (184.87s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataCellsFilter (25.04s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/database (22.44s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataLocation (25.17s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTag (22.00s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy (21.33s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/table (23.59s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns (23.34s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/basic (21.96s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation 191.289s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccLakeFormation_serial/^PermissionsDataSource$$' PKG=lakeformation
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lakeformation/... -v -count 1 -parallel 20 -run=TestAccLakeFormation_serial/^PermissionsDataSource$ -timeout 360m
2024/12/13 09:03:43 Initializing Terraform AWS Provider...
=== RUN TestAccLakeFormation_serial
=== PAUSE TestAccLakeFormation_serial
=== CONT TestAccLakeFormation_serial
=== RUN TestAccLakeFormation_serial/PermissionsDataSource
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/table
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/basic
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/dataCellsFilter
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/database
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/dataLocation
=== RUN TestAccLakeFormation_serial/PermissionsDataSource/lfTag
--- PASS: TestAccLakeFormation_serial (170.89s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource (170.89s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy (21.85s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/table (19.90s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns (22.76s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/basic (20.04s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataCellsFilter (23.97s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/database (21.70s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataLocation (20.16s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTag (20.50s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation 176.378s
@diofeher thank you for the contribution! 🎉 |
Nice to see this one being merged :) Thanks @johnsonaj and @ewbankkit |
This functionality has been released in v5.82.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! |
When Lake Formation permissions are set without alphabetical order, every time a new Terraform apply is made, these resources are recreated. This can revoke permissions for long-running Glue jobs, causing significant production problems.
To resolve this issue, instead of using a list of strings, a set should be used.
Description:
Description
IMPORTANT: I've modified the existing test:
TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectPlus
changing the order of the permissions arguments because it wasn't needed to add a new test
To reproduce this error, you need to create an AWS Lake Formation permission with the following code:
The critical issue lies in the order of permissions. If "SELECT" is not the first member, it may conflict when permissions are returned from the provider, potentially causing the resource to be replaced when applying the new configuration.
Relations
Relates to #33023
Closes #31096 and #22570
References
Output from Acceptance Testing
Before:
After: