-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
LF-Tag support for aws_lakeformation_permissions #19648
LF-Tag support for aws_lakeformation_permissions #19648
Conversation
e796126
to
5bf3443
Compare
255934f
to
924eb29
Compare
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
Hi @zhelding @breathingdust! Any way I can find out where this sits with you guys in terms of prioritisation? Cheers :) |
Super critical feature from AWS to have in terraform. We've tested a build from this branch and it works great!! It would be awesome to get this merged into an official release 🚀 🚀 🚀 |
@danielcmessias - Thank you for working on this feature. Could you please rebase the code so that it can be merged? Also related: |
75d7bc5
to
19a63f1
Compare
PR has been refactored into Service Packages (#21306). Massive thanks to @stevenayers for his work on this! |
@zhelding & @ewbankkit conflicts sorted when you get a chance, thank you! ❤️ |
@justinretzolk did a review of this PR make it into Q2? |
19a63f1
to
25fe426
Compare
@YakDriver Rebased! |
@danielcmessias @stevenayers It looks like only a little cleanup is needed. Basically, this looks really good after a brief look. If it's good with you, I'll clean it up and we'll see if we can get it merged. If you are planning to make any changes, please coordinate with me. Thanks for all the great work! |
No objections from me, go for it! |
My impression is that this closes #19640 and I changed it to close it. If anyone objects or I'm missing something, let me know. |
@YakDriver resource "aws_lakeformation_tag_resource" "" {
catalog_id = "123456789"
# A block to identify the Data Catalog Resource that the tag is being assigned to. Similar to aws_lakeformation_permissions
database {
#similar to aws_lakeformation_permissions
}
table {
#similar to aws_lakeformation_permissions
}
table_with_columns {
#similar to aws_lakeformation_permissions
}
# The tags that are being assigned
lf_tags = [
{
catalog_id = "123456789"
tag_key = "module"
tag_values = ["A"]
},
{
catalog_id = "123456789"
tag_key = "region"
tag_values = ["west"]
}
]
} To my knowledge, there is no open PR that adds that functionality. But regarding this PR, no incoming changes from me, looking forward to getting it merged. Thanks for reviewing! :) |
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.
Looks good! 🎉
% make testacc TESTS="TestAccLakeFormation_serial/LFTags|TestAccLakeFormation_serial/PermissionsDataSource|TestAccLakeFormation_serial/PermissionsBasic" PKG=lakeformation
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lakeformation/... -v -count 1 -parallel 20 -run='TestAccLakeFormation_serial/LFTags|TestAccLakeFormation_serial/PermissionsDataSource|TestAccLakeFormation_serial/PermissionsBasic' -timeout 180m
--- PASS: TestAccLakeFormation_serial (546.83s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic (288.59s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/disappears (87.15s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTag (23.81s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTagPolicy (25.10s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/basic (24.03s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/database (23.92s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseIAMAllowed (45.17s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseMultiple (33.22s)
--- PASS: TestAccLakeFormation_serial/PermissionsBasic/dataLocation (26.18s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource (198.13s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/basic (24.15s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/database (34.09s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataLocation (27.75s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTag (24.42s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy (24.42s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/table (28.31s)
--- PASS: TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns (34.99s)
--- PASS: TestAccLakeFormation_serial/LFTags (60.11s)
--- PASS: TestAccLakeFormation_serial/LFTags/basic (17.10s)
--- PASS: TestAccLakeFormation_serial/LFTags/disappears (14.17s)
--- PASS: TestAccLakeFormation_serial/LFTags/values (28.84s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation 548.288s
This functionality has been released in v4.20.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! |
Excuse my ignorance but I can't see this brilliant enhancement on the changelog. I can see docs have been updated and I can't wait to get stuck into using this capability. Thanks for all the work to enable this. Ahead of cloudformation again. |
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. |
Community Note
Relates #19640
Updates
21/04/2022: PR has been refactored into Service Packages (#21306). Massive thanks to @stevenayers for his work on this!
04/08/2021: I have added the next step for TBAC which is to support LFTagPolicy resource, allowing principals to be assigned permissions based on tag policy expression (as described here). Since this PR is still awaiting triage, I've comitted the new functionality here instead of opening a new PR because, personally, I think it's easier to review together. Happy to split this new functionality into a subsequent branch if you'd prefer! The addition is made in this commit.
03/08/2021: I have renamed 'policy tag' to 'LF Tag' everywhere, to ensure consistency with the AWS API and Console. The change is made in this commit.
To be reviewed AFTER #19523
This work depends on the
aws_lakeformation_lf_tag
resource in the linked PR, so this branch is a continuation of that one. Files Changed is going to be wrong, relevant commits are downstream of 5bf3443 (inclusive). Let me know if there's a different preferred practice for dependant PRs.Adds the two new resources to aws_lakeformation_permissions that were made available with the TBAC workflow, LFTag and LFTagPolicy. This is essentially steps 4 and 5 in AWS TBAC documentation.
lf_tag
Allows granting ASSOCIATE and DESCRIBE permissions to Lake Formation Policy Tags, and reading those permissions from a data source.
Example:
lf_tag_resource
Allows granting LF-Tag policies that give permissions to principals based on a set of tag expressions.
Example:
Output from acceptance testing: