Lake Formation permissions: Permission changes not forcing new with IAM_ALLOWED_PRINCIPALS #20048
Labels
bug
Addresses a defect in current functionality.
service/glue
Issues and PRs that pertain to the glue service.
service/iam
Issues and PRs that pertain to the iam service.
service/lakeformation
Issues and PRs that pertain to the lakeformation service.
Milestone
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.0.1
Affected Resource(s)
Terraform Configuration Files
Adding
IAM_ALLOWED_PRINCIPALS
permissions has no specific benefit but mimics what happens automatically in some accounts (e.g., not upgraded to Lake Formation model). Also, this can be done manually by practitioners. As such, it would be ideal if the AWS provider can work seamlessly with or without these extra permissions. Whether that is possible remains to be seen.Debug Output
Expected Behavior
Permissions should be updated to fewer columns.
If it were doing
ForceNew
, it would look like this:Actual Behavior
You can add column permissions but you can't remove them:
rating
,year
👉rating
,year
,movie_title
rating
,year
,movie_title
👉rating
,year
Steps to Reproduce
terraform apply
odewissug-svalbard
will now have 2 columnsaws_lakeformation_permissions.test.table_with_columns.column_names
to["rating", "year", "movie_title"]
terraform apply
odewissug-svalbard
will now have the 3 columnsaws_lakeformation_permissions.test.table_with_columns.column_names
to["rating"]
terraform apply
odewissug-svalbard
will still have the 3 columns but should be 1Workaround
By manually removing the
IAM_ALLOWED_PRINCIPALS
permissions from affected tables and databases (e.g., using the AWS console), I have been able to get the AWS provider to correctly manage permissions.Important Factoids
IAM_ALLOWED_PRINCIPALS
permissions, the provider works as intendedIAM_ALLOWED_PRINCIPALS
permissions, Terraform's plan includes~ column_names = [ # forces replacement
andApply complete! Resources: 1 added, 0 changed, 1 destroyed.
IAM_ALLOWED_PRINCIPALS
permissions, Terraform's plan does not include~ column_names = [ # forces replacement
and showsApply complete! Resources: 1 added, 0 changed, 0 destroyed.
IAM_ALLOWED_PRINCIPALS
permissions, the AWS provider is not doing forced replacement as it should, which is why the number of permissions cannot be reduced but only increased. Decreasing requires revoking existing permissions and then granting the new permissions (which is what happens withoutIAM_ALLOWED_PRINCIPALS
).References
The text was updated successfully, but these errors were encountered: