-
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
aws_lakeformation_permissions support AllIAMPrincipals special principal #38600
Merged
johnsonaj
merged 12 commits into
hashicorp:main
from
nickdelnano:b-aws_lakeformation_permissions-iamprincipals
Dec 18, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b0f40c9
aws_lakeformation_permissions support IAMPrincipals special principal
nickdelnano 063a75c
aws_lakeformation_permissions IAMPrincipals docs
nickdelnano 332016e
add changelog for aws_lakeformation_permissions IAMPrincipals
nickdelnano 3ba6523
Merge branch 'main' into b-aws_lakeformation_permissions-iamprincipals
nickdelnano 938cad5
lakeformation_validation: simplify IAMPrincipals validation
johnsonaj 36387e8
lakeformation_validation: cleanup
johnsonaj 22f1763
tweak CHANGELOG entry
johnsonaj 32db3d3
Merge branch 'main' into b-aws_lakeformation_permissions-iamprincipals
johnsonaj 46ade00
chore: linter
johnsonaj 636d7c3
chore: no naked returns
johnsonaj ba357e7
tweak CHANGELOG entry
johnsonaj 707c23b
chore: semgrep fix
johnsonaj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
resource/aws_lakeformation_permissions: Add support for `IAMPrincipals` principal group | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,10 @@ func TestValidPrincipal(t *testing.T) { | |
} | ||
|
||
validNames := []string{ | ||
"IAM_ALLOWED_PRINCIPALS", // Special principal | ||
acctest.Ct12Digit, // lintignore:AWSAT005 // Example Account ID (Valid looking but not real) | ||
"111122223333", // lintignore:AWSAT005 // Example Account ID (Valid looking but not real) | ||
"IAM_ALLOWED_PRINCIPALS", // Special principal | ||
"123456789012:IAMPrincipals", // Special principal, Example Account ID (Valid looking but not real) | ||
acctest.Ct12Digit, // lintignore:AWSAT005 // Example Account ID (Valid looking but not real) | ||
"111122223333", // lintignore:AWSAT005 // Example Account ID (Valid looking but not real) | ||
"arn:aws-us-gov:iam::357342307427:role/tf-acc-test-3217321001347236965", // lintignore:AWSAT005 // IAM Role | ||
"arn:aws:iam::123456789012:user/David", // lintignore:AWSAT005 // IAM User | ||
"arn:aws:iam::123456789012:federated-user/David", // lintignore:AWSAT005 // IAM Federated User | ||
|
@@ -45,7 +46,10 @@ func TestValidPrincipal(t *testing.T) { | |
invalidNames := []string{ | ||
"IAM_NOT_ALLOWED_PRINCIPALS", // doesn't exist | ||
names.AttrARN, | ||
"1234567890125", //not an account id | ||
"1234567890125", //not an account id | ||
"IAMPrincipals", // incorrect representation | ||
"1234567890125:IAMPrincipals", // incorrect representation, account id invalid length | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. best viewed with "hide whitespace" enabled |
||
"1234567890125:IAMPrincipal", | ||
"arn:aws", | ||
"arn:aws:logs", //lintignore:AWSAT005 | ||
"arn:aws:logs:region:*:*", //lintignore:AWSAT005 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,21 @@ The resulting permissions depend on whether the table had `IAMAllowedPrincipals` | |
| ---- | ---- | | ||
| `SELECT` column wildcard (i.e., all columns) | `SELECT` on `"event"` (as expected) | | ||
|
||
## `ALLIAMPrincipals` group | ||
|
||
AllIAMPrincipals is a pseudo-entity group that acts like a Lake Formation principal. The group includes all IAMs in the account that is defined. | ||
|
||
resource "aws_lakeformation_permissions" "example" { | ||
permissions = ["SELECT"] | ||
principal = "123456789012:IAMPrincipals" | ||
|
||
table_with_columns { | ||
database_name = aws_glue_catalog_table.example.database_name | ||
name = aws_glue_catalog_table.example.name | ||
column_names = ["event"] | ||
} | ||
} | ||
|
||
Comment on lines
+90
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
## Using Lake Formation Permissions | ||
|
||
Lake Formation grants implicit permissions to data lake administrators, database creators, and table creators. These implicit permissions cannot be revoked _per se_. If this resource reads implicit permissions, it will attempt to revoke them, which causes an error when the resource is destroyed. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
best viewed with "hide whitespace" enabled