Skip to content

Commit

Permalink
Merge pull request #1103 from jbleduigou/kinesis-tags
Browse files Browse the repository at this point in the history
feat: retrieve tags of Kinesis Data Streams
  • Loading branch information
mlabouardy authored Oct 17, 2023
2 parents 90b5320 + 25c9c28 commit 4b89403
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions providers/aws/kinesis/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ func Streams(ctx context.Context, client ProviderClient) ([]Resource, error) {
}

for _, stream := range output.StreamSummaries {
tags := make([]Tag, 0)
tagsResp, err := kinesisClient.ListTagsForStream(context.Background(), &kinesis.ListTagsForStreamInput{
StreamARN: stream.StreamARN,
})
if err == nil {
for _, t := range tagsResp.Tags {
tags = append(tags, Tag{
Key: aws.ToString(t.Key),
Value: aws.ToString(t.Value),
})
}
} else {
log.Warn("Failed to fetch tags for kinesis streams")
}
resources = append(resources, Resource{
Provider: "AWS",
Account: client.Name,
Expand All @@ -40,6 +54,7 @@ func Streams(ctx context.Context, client ProviderClient) ([]Resource, error) {
Cost: 0,
CreatedAt: *stream.StreamCreationTimestamp,
FetchedAt: time.Now(),
Tags: tags,
Link: fmt.Sprintf("https://%s.console.aws.amazon.com/kinesis/home?region=%s#/streams/details/%s", client.AWSClient.Region, client.AWSClient.Region, *stream.StreamName),
})
consumers, err := getStreamConsumers(ctx, kinesisClient, stream, client.Name, client.AWSClient.Region)
Expand Down

0 comments on commit 4b89403

Please sign in to comment.