Closed YakDriver closed 3 years ago
This functionality has been released in v3.49.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!
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.
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
20047