Remove aws_lakeformation_permissions from Terraform code or run terraform destroy will revoke corresponding Lake Formation permission
Actual Behavior
Destroy aws_lakeformation_permissions.column resource not revoke the permission on Lake Formation, even it is showing resource will be destroy in the plan.
The bug only happens if:
Multiple aws_lakeformation_permissions resources have the same principal
The table level includes permissions does not include in column level. (see below Terraform config, if adding DESCRIBE to both aws_lakeformation_permissions permission, a DESCRIBE permission on the LakeFormation table will be granted and won't hit this bug)
aws_lakeformation_permissions.column destroy first, or destroy together with aws_lakeformation_permissions.table resource (regardless the order during apply time)
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.9.5
AWS Provider Version
5.64.0
Affected Resource(s)
aws_lakeformation_permissions
Expected Behavior
Remove
aws_lakeformation_permissions
from Terraform code or runterraform destroy
will revoke corresponding Lake Formation permissionActual Behavior
Destroy
aws_lakeformation_permissions.column
resource not revoke the permission on Lake Formation, even it is showing resource will be destroy in the plan.The bug only happens if:
Multiple
aws_lakeformation_permissions
resources have the sameprincipal
The table level includes permissions does not include in column level. (see below Terraform config, if adding
DESCRIBE
to bothaws_lakeformation_permissions
permission, aDESCRIBE
permission on the LakeFormation table will be granted and won't hit this bug)aws_lakeformation_permissions.column
destroy first, or destroy together withaws_lakeformation_permissions.table
resource (regardless the order during apply time)Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
terraform apply
to create the permission and other dependent resourcesaws_lakeformation_permissions.column
resource blockterraform apply
againDebug Output
Apply log
Showing only
SELECT
permission will be added, actual:SELECT
permission will be added to LakeFormation (expected)SELECT
and the permissions in table level (DESCRIBE
in this case) will be added to state file (unexpected, not showing on plan)resource "aws_lakeformation_permissions" "column" {
catalog_resource = false
id = (known after apply)
permissions = [
permissions_with_grant_option = []
principal = "arn:aws:iam::222222222222:role/my-test-role"
data_location (known after apply)
database (known after apply)
lf_tag (known after apply)
lf_tag_policy (known after apply)
table (known after apply)
table_with_columns {
Destroy log
DESCRIBE
permission in state filePanic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None