The tagged Glue table was deleted. Therefore, on the next terraform apply, the aws_lakeformation_resource_lf_tags resource should be removed from state as the linked resource has been destroyed.
Actual Behavior
An error was thrown in the plan which prevented an apply from occurring to delete the tags.
Relevant Error/Panic Output Snippet
Error: reading AWS Lake Formation Resource LF Tags: operation error LakeFormation: GetResourceLFTags, https response error StatusCode: 400, RequestID: fake-request-id, EntityNotFoundException: Entity Not Found
Note that the database_name and name in aws_lakeformation_resource_lf_tags are purposefully stated directly so as not to have direct coupling of the resources.
Steps to Reproduce
Create Glue database and table on the console. Ideally not with Terraform as we don't want to have dependencies being directly specified.
Create LakeFormation tags with aws_lakeformation_lf_tag
Tag the Glue table with aws_lakeformation_resource_lf_tags
Delete the Glue table.
Run terraform plan.
Debug Output
No response
Panic Output
No response
Important Factoids
Ordinarily, the Glue table would be created in the same configuration but in this case it is not as the creation is being done with dbt and is being handled in a separate process. The tagging is therefore being done in it's own terraform environment. This loose coupling unveiled that a deleted table is not catered for.
After a very brief look at the provider code. It seems like a missing table is not being accounted for. Go is not my forte, so please feel free to have a look and confirm this for yourself.
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.7.5
AWS Provider Version
5.45.0
Affected Resource(s)
aws_lakeformation_resource_lf_tags
Expected Behavior
The tagged Glue table was deleted. Therefore, on the next terraform apply, the
aws_lakeformation_resource_lf_tags
resource should be removed from state as the linked resource has been destroyed.Actual Behavior
An error was thrown in the plan which prevented an apply from occurring to delete the tags.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Note that the
database_name
andname
inaws_lakeformation_resource_lf_tags
are purposefully stated directly so as not to have direct coupling of the resources.Steps to Reproduce
aws_lakeformation_lf_tag
aws_lakeformation_resource_lf_tags
Debug Output
No response
Panic Output
No response
Important Factoids
Ordinarily, the Glue table would be created in the same configuration but in this case it is not as the creation is being done with dbt and is being handled in a separate process. The tagging is therefore being done in it's own terraform environment. This loose coupling unveiled that a deleted table is not catered for.
After a very brief look at the provider code. It seems like a missing table is not being accounted for. Go is not my forte, so please feel free to have a look and confirm this for yourself.
References
No response
Would you like to implement a fix?
None