Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kinesis and ecs warnings #805 #809

Merged
merged 1 commit into from May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions providers/aws/aws.go
Expand Up @@ -53,8 +53,6 @@ func listOfSupportedServices() []providers.FetchDataFunction {
eks.KubernetesClusters,
cloudfront.Distributions,
dynamodb.Tables,
ecs.Tasks,
ecs.Services,
ecs.Clusters,
ecr.Repositories,
sns.Topics,
Expand Down Expand Up @@ -84,7 +82,7 @@ func listOfSupportedServices() []providers.FetchDataFunction {
systemsmanager.MaintenanceWindows,
ec2.VpcEndpoints,
ec2.VpcPeeringConnections,
kinesis.Shards,
kinesis.Streams,
}
}

Expand Down
66 changes: 0 additions & 66 deletions providers/aws/ecs/services.go

This file was deleted.

66 changes: 0 additions & 66 deletions providers/aws/ecs/tasks.go

This file was deleted.

Expand Up @@ -13,28 +13,29 @@ import (
. "github.com/tailwarden/komiser/providers"
)

func Shards(ctx context.Context, client ProviderClient) ([]Resource, error) {
func Streams(ctx context.Context, client ProviderClient) ([]Resource, error) {
resources := make([]Resource, 0)
var config kinesis.ListShardsInput
var config kinesis.ListStreamsInput
kinesisClient := kinesis.NewFromConfig(*client.AWSClient)

for {
output, err := kinesisClient.ListShards(ctx, &config)
output, err := kinesisClient.ListStreams(ctx, &config)
if err != nil {
return resources, err
}

for _, shard := range output.Shards {
for _, stream := range output.StreamSummaries {
resources = append(resources, Resource{
Provider: "AWS",
Account: client.Name,
Service: "Kinesis Shard",
ResourceId: *shard.ShardId,
Service: "Kinesis Stream",
ResourceId: *stream.StreamARN,
Region: client.AWSClient.Region,
Name: *shard.ShardId,
Name: *stream.StreamName,
Cost: 0,
CreatedAt: *stream.StreamCreationTimestamp,
FetchedAt: time.Now(),
Link: fmt.Sprintf("https://%s.console.aws.amazon.com/kinesis/home?region=%s#/streams/details/%s", client.AWSClient.Region, client.AWSClient.Region, *shard.ShardId),
Link: fmt.Sprintf("https://%s.console.aws.amazon.com/kinesis/home?region=%s#/streams/details/%s", client.AWSClient.Region, client.AWSClient.Region, *stream.StreamName),
})
}

Expand All @@ -49,7 +50,7 @@ func Shards(ctx context.Context, client ProviderClient) ([]Resource, error) {
"provider": "AWS",
"account": client.Name,
"region": client.AWSClient.Region,
"service": "Kinesis Shard",
"service": "Kinesis Stream",
"resources": len(resources),
}).Info("Fetched resources")

Expand Down