Skip to content

Service Lake Formation GetResourceLFTags Missing Table and Column Tags #2743

Closed
@brascher

Description

Acknowledgements

Describe the bug

When calling the GetResourceLFTags() service in Lake Formation for a specific column, the LFTagsOnTable and LFTagsOnColumns slices in the GetResourceLFTagsOutput struct are empty.

Expected Behavior

All LF resource tags that are inherited from the database and table, along with any resource tags added to the column, are included in the GetResourceLFTagsOutput struct.

Current Behavior

LF resource tags inherited from the table and added to the column specifically are missing from the GetResourceLFTagsOutput struct.

Reproduction Steps

import (
	"context"
	"fmt"
	"log"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/lakeformation"
	"github.com/aws/aws-sdk-go-v2/service/lakeformation/types"
)

func main() {
	cfg, err := config.LoadDefaultConfig(context.TODO(),
		config.WithSharedConfigProfile("dev_profile"))

	svc := lakeformation.NewFromConfig(cfg)

	db := &types.DatabaseResource{
		Name:      aws.String("db_name"),
		CatalogId: aws.String("1234567890"),
	}
	tbl := &types.TableResource{
		DatabaseName: aws.String("db_name"),
		CatalogId:    aws.String("1234567890"),
		Name:         aws.String("tbl_name"),
	}
	cols := &types.TableWithColumnsResource{
		DatabaseName: aws.String("db_name"),
		CatalogId:    aws.String("1234567890"),
		Name:         aws.String("tbl_name"),
		ColumnNames:  []string {"distributionchannelcode"},
	}

	resource := &types.Resource{
		Database:         db,
		Table:            tbl,
		TableWithColumns: cols,
	}
	input := &lakeformation.GetResourceLFTagsInput{
		Resource:           resource,
		CatalogId:          aws.String("1234567890"),
		ShowAssignedLFTags: aws.Bool(true),
	}

	resp, err := svc.GetResourceLFTags(context.TODO(), input)
	if err != nil {
		log.Fatalf("Failed to list LF Tags, %v", err)
	}

	fmt.Printf("%+v", resp)

	fmt.Println("DB LF Tags")
	fmt.Println(len(resp.LFTagOnDatabase))
	for _, tt := range resp.LFTagOnDatabase {
		fmt.Printf("%s : %s in catalog %s \n", *tt.TagKey, tt.TagValues, *tt.CatalogId)
	}

	fmt.Println("Table LF Tags")
	fmt.Println(len(resp.LFTagsOnTable))
	for _, aa := range resp.LFTagsOnTable {
		fmt.Printf("%s : %s in catalog %s \n", *aa.TagKey, aa.TagValues, *aa.CatalogId)
	}

	fmt.Println("Column LF Tags")
	fmt.Println(len(resp.LFTagsOnColumns))
	for _, cc := range resp.LFTagsOnColumns {
		fmt.Printf("Column Name: %s \n", *cc.Name)
		fmt.Println(len(cc.LFTags))
		for _, jj := range cc.LFTags {
			fmt.Printf("%s : %s in catalog %s \n", *jj.TagKey, jj.TagValues, *jj.CatalogId)
		}
	}
}

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.30.3
github.com/aws/aws-sdk-go-v2/config v1.27.27
github.com/aws/aws-sdk-go-v2/service/lakeformation v1.35.3
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/smithy-go v1.20.3 // indirect

Compiler and Version used

go version go1.19.8 windows/amd64

Operating System and version

Windows 10 Enterprise 22H2

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions