[Bug]: Resource tag state reads ignorant of inheritance #31909
Labels
bug
Addresses a defect in current functionality.
service/lakeformation
Issues and PRs that pertain to the lakeformation service.
Milestone
Terraform Core Version
1.3.7
AWS Provider Version
4.67.0
Affected Resource(s)
Expected Behavior
When tag values are applied at a table or column level, other tag values inherited from the database or table level should be ignored when reading back state.
For example, consider this scenario:
my_table
exists in databasemy_database
foo=bar
is applied tomy_database
and thus inherited bymy_table
bam=baz
is also applied directly tomy_table
The
GetResourceLFTags
API call to Lake Formation will have bothfoo=bar
andbam=baz
in theLFTagsOnTable
structure formy_table
. However onlybam=baz
is applied directly to the table andfoo=bar
should be ignored for purposes of determining the state of theaws_lakeformation_resource_lf_tags
resource with thetable {database_name = "my_database", name = "my_table"}
block.Actual Behavior
Terraform perceives state drift on every refresh because it sees the inherited tags and (correctly) identifies that they are not part of the corresponding table/column-level
aws_lakeformation_resource_lf_tags
resource. All tags of tables and columns with inherited tag values are destroyed and recreated by each plan.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Apply and plan again to see phantom state drift
Debug Output
No response
Panic Output
No response
Important Factoids
The response from the
GetResourceLFTags
Lake Formation API call includes the full inheritance hierarchy for a given table/column viaLFTagOnDatabase
,LFTagsOnTable
, andLFTagsOnColumns
. By reducing over these it should be possible to resolve which tag values are being applied at the table/column level and thus resolve accurate state.References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: