Skip to content

Commit

Permalink
lint: unused
Browse files Browse the repository at this point in the history
Signed-off-by: Azanul <[email protected]>
  • Loading branch information
Azanul committed Dec 27, 2023
1 parent 1fc698d commit ba2a95b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions providers/aws/lambda/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ package lambda
import (
"context"
"fmt"
"strconv"
"time"

log "github.com/sirupsen/logrus"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
cloudwatchTypes "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
"github.com/aws/aws-sdk-go-v2/service/costexplorer"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/lambda"
lambdaTypes "github.com/aws/aws-sdk-go-v2/service/lambda/types"
Expand Down Expand Up @@ -190,28 +188,6 @@ func Functions(ctx context.Context, client providers.ProviderClient) ([]models.R
return resources, nil
}

func getLambdaCostAndUsage(ctx context.Context, region string) (float64, error) {
total := 0.0
costexplorerOutputList, ok := ctx.Value(awsUtils.CostexplorerKey).([]*costexplorer.GetCostAndUsageOutput)
if !ok || costexplorerOutputList == nil {
return 0, fmt.Errorf("incorrect costexplorerOutputList")
}
for _, costexplorerOutput := range costexplorerOutputList {
for _, group := range costexplorerOutput.ResultsByTime {
for _, v := range group.Groups {
if v.Keys[0] == "Lambda" && v.Keys[1] == region {
amt, err := strconv.ParseFloat(*v.Metrics["UnblendedCost"].Amount, 64)
if err != nil {
return 0, err
}
total += amt
}
}
}
}
return total, nil
}

func getLambdaRelations(config aws.Config, lambda lambdaTypes.FunctionConfiguration) (rel []models.Link) {
// Get associated IAM roles
if lambda.Role != nil {
Expand Down

0 comments on commit ba2a95b

Please sign in to comment.