From 4b0445ac46e5cd2d72193e2134421aedb343f4a0 Mon Sep 17 00:00:00 2001 From: Azanul Date: Tue, 28 Nov 2023 19:17:12 +0530 Subject: [PATCH 01/41] feat: aws lambda integration Signed-off-by: Azanul --- go.mod | 3 ++- go.sum | 13 ++++++++++++- providers/aws/aws.go | 32 +++++++++++++++++++++++++++++-- providers/aws/lambda/functions.go | 32 ++++++++++++++++++++++++++++++- providers/aws/utils/utils.go | 14 ++++++++++---- 5 files changed, 85 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7c46e0ce3..ff379db32 100644 --- a/go.mod +++ b/go.mod @@ -107,6 +107,7 @@ require ( github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 // indirect github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 + github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 // indirect github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect @@ -116,7 +117,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect - github.com/aws/smithy-go v1.14.2 // indirect + github.com/aws/smithy-go v1.17.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect diff --git a/go.sum b/go.sum index de970de02..3309471f5 100644 --- a/go.sum +++ b/go.sum @@ -72,6 +72,8 @@ github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3eP github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= +github.com/aws/aws-sdk-go-v2 v1.23.1 h1:qXaFsOOMA+HsZtX8WoCa+gJnbyW7qyFFBlPqvTSzbaI= +github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3/go.mod h1:gNsR5CaXKmQSSzrmGxmwmct/r+ZBfbxorAuXYsj/M5Y= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= @@ -91,6 +93,8 @@ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 h1:LAm3Ycm9HJfbSCd5I+wqC2S9Ej7FPrgr5CQoOljJZcE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4/go.mod h1:xEhvbJcyUf/31yfGSQBe01fukXwXJ0gxDp7rLfymWE0= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= @@ -101,6 +105,8 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 h1:4GV0kKZzUxiWxSVpn/9gwR0g21NF1Jsyduzo9rHgC/Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4/go.mod h1:dYvTNAggxDZy6y1AF7YDwXsPuHFy/VNEpEI/2dWK9IU= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 h1:tEEHn+PGAxRVqMPEhtU8oCSW/1Ge3zP5nUgPrGQNUPs= @@ -117,6 +123,10 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 h1:sXs+JjIwgKA27t+5O github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9/go.mod h1:CpWhQvomfSbbrfUhq9sq/w2x4wbkQOAqGJbcPS2AINA= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 h1:3EaaGPAkwUHVbDKx/TCTAubBUqV8F6++5EaiSiXQgN0= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0/go.mod h1:a+PVnn9VNPzPVUiXKXDHK21PSi/TzEKQNIsvSlVXgFY= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5 h1:Bhd9IP8gtuw8JWAsLF7KR9sVQ4mbw/jHe2FKG5MS2kU= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5/go.mod h1:7KdI1o605B1NKFzhsexTUfwneh2zdxFmIhgTZoKLBLo= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.3 h1:+rRHEftLPmqpgTVIhJg69E4WqpdW62jCpIAGvRwtxYA= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.3/go.mod h1:1ujrFMokNtwDv3fwb9RBwdeXS+RonpIeV9uh19GJoH8= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3/go.mod h1:BiglbKCG56L8tmMnUEyEQo422BO9xnNR8vVHnOsByf8= github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0 h1:OMzx7qC+hOYJoQYq7RnYkjgCnKTsdIcEM08AUtsXH6A= @@ -181,8 +191,9 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/ github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= +github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= diff --git a/providers/aws/aws.go b/providers/aws/aws.go index aa0ba4338..fd0c64e59 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -3,9 +3,12 @@ package aws import ( "context" "strings" + "time" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/costexplorer" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" log "github.com/sirupsen/logrus" - "github.com/tailwarden/komiser/models" "github.com/tailwarden/komiser/providers" "github.com/tailwarden/komiser/providers/aws/apigateway" @@ -31,7 +34,9 @@ import ( "github.com/tailwarden/komiser/providers/aws/sns" "github.com/tailwarden/komiser/providers/aws/sqs" "github.com/tailwarden/komiser/providers/aws/systemsmanager" + awsUtils "github.com/tailwarden/komiser/providers/aws/utils" "github.com/tailwarden/komiser/utils" + "github.com/uptrace/bun" ) @@ -107,6 +112,29 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region listOfSupportedRegions = regions } + costexplorerClient := costexplorer.NewFromConfig(*client.AWSClient) + costexplorerOutput, err := costexplorerClient.GetCostAndUsage(ctx, &costexplorer.GetCostAndUsageInput{ + Granularity: "DAILY", + Metrics: []string{"UnblendedCost"}, + TimePeriod: &types.DateInterval{ + Start: aws.String(utils.BeginningOfMonth(time.Now()).Format("2006-01-02")), + End: aws.String(time.Now().Format("2006-01-02")), + }, + GroupBy: []types.GroupDefinition{ + { + Key: aws.String("SERVICE"), + Type: "DIMENSION", + }, + { + Key: aws.String("REGION"), + Type: "DIMENSION", + }, + }, + }) + if err != nil { + log.Warn("Couldn't fetch cost and usage data:", err) + } + ctxWithCostexplorerOutput := context.WithValue(ctx, awsUtils.CostexplorerKey, costexplorerOutput) for _, region := range listOfSupportedRegions { c := client.AWSClient.Copy() c.Region = region @@ -116,7 +144,7 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } for _, fetchResources := range listOfSupportedServices() { wp.SubmitTask(func() { - resources, err := fetchResources(ctx, client) + resources, err := fetchResources(ctxWithCostexplorerOutput, client) if err != nil { log.Warnf("[%s][AWS] %s", client.Name, err) } else { diff --git a/providers/aws/lambda/functions.go b/providers/aws/lambda/functions.go index 9bca7d517..201a6a969 100644 --- a/providers/aws/lambda/functions.go +++ b/providers/aws/lambda/functions.go @@ -3,6 +3,7 @@ package lambda import ( "context" "fmt" + "strconv" "time" log "github.com/sirupsen/logrus" @@ -10,6 +11,7 @@ import ( "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" @@ -32,6 +34,11 @@ func Functions(ctx context.Context, client providers.ProviderClient) ([]models.R cloudwatchClient := cloudwatch.NewFromConfig(*client.AWSClient) lambdaClient := lambda.NewFromConfig(*client.AWSClient) + serviceCost, err := getLambdaCostAndUsage(ctx, client.AWSClient.Region) + if err != nil { + log.Warnln("Couldn't fetch Lambda cost and usage:", err) + } + tempRegion := client.AWSClient.Region client.AWSClient.Region = "us-east-1" pricingClient := pricing.NewFromConfig(*client.AWSClient) @@ -157,7 +164,8 @@ func Functions(ctx context.Context, client providers.ProviderClient) ([]models.R Name: *o.FunctionName, Cost: monthlyCost, Metadata: map[string]string{ - "runtime": string(o.Runtime), + "runtime": string(o.Runtime), + "serviceCost": fmt.Sprint(serviceCost), }, Relations: relations, FetchedAt: time.Now(), @@ -182,6 +190,28 @@ 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 { diff --git a/providers/aws/utils/utils.go b/providers/aws/utils/utils.go index 5ed566701..ccb9dcc66 100644 --- a/providers/aws/utils/utils.go +++ b/providers/aws/utils/utils.go @@ -8,6 +8,12 @@ import ( "github.com/aws/aws-sdk-go-v2/service/pricing" ) +type AWSCtxKey uint8 + +const ( + CostexplorerKey AWSCtxKey = iota +) + type ProductEntry struct { Product struct { Attributes struct { @@ -93,8 +99,8 @@ func GetPriceMap(pricingOutput *pricing.GetProductsOutput, field string) (map[st } func Int64PtrToFloat64(i *int64) float64 { - if i == nil { - return 0.0 // or any default value you prefer - } - return float64(*i) + if i == nil { + return 0.0 // or any default value you prefer + } + return float64(*i) } From d1861c9128d85115def5d40e3e62d8def2e5125a Mon Sep 17 00:00:00 2001 From: Azanul Date: Tue, 28 Nov 2023 22:26:59 +0530 Subject: [PATCH 02/41] fix: go.mod Signed-off-by: Azanul --- go.mod | 16 ++++++++-------- go.sum | 39 ++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index ff379db32..d0e59f57e 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 github.com/BurntSushi/toml v1.2.1 - github.com/aws/aws-sdk-go-v2 v1.21.0 + github.com/aws/aws-sdk-go-v2 v1.23.0 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0 github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2 @@ -102,21 +102,21 @@ require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 // indirect github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 // indirect - github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4 - github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 - github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 - github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect + github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2 + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2 + github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0 + github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 // indirect github.com/aws/smithy-go v1.17.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bytedance/sonic v1.9.1 // indirect diff --git a/go.sum b/go.sum index 3309471f5..4b9c0a830 100644 --- a/go.sum +++ b/go.sum @@ -67,13 +67,11 @@ github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1 github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.8/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= -github.com/aws/aws-sdk-go-v2 v1.23.1 h1:qXaFsOOMA+HsZtX8WoCa+gJnbyW7qyFFBlPqvTSzbaI= -github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= +github.com/aws/aws-sdk-go-v2 v1.23.0 h1:PiHAzmiQQr6JULBUdvR8fKlA+UPKLT/8KbiqpFBWiAo= +github.com/aws/aws-sdk-go-v2 v1.23.0/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3/go.mod h1:gNsR5CaXKmQSSzrmGxmwmct/r+ZBfbxorAuXYsj/M5Y= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= @@ -88,25 +86,21 @@ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32/go.mod h1:RudqOgadTWdcS3t/erPQo24pcVEoYyqj/kKW5Vya21I= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 h1:LAm3Ycm9HJfbSCd5I+wqC2S9Ej7FPrgr5CQoOljJZcE= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4/go.mod h1:xEhvbJcyUf/31yfGSQBe01fukXwXJ0gxDp7rLfymWE0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 h1:DUwbD79T8gyQ23qVXFUthjzVMTviSHi3y4z58KvghhM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3/go.mod h1:7sGSz1JCKHWWBHq98m6sMtWQikmYPpxjqOydDemiVoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26/go.mod h1:vq86l7956VgFr0/FWQ2BWnK07QC3WYsepKzy33qqY5U= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 h1:4GV0kKZzUxiWxSVpn/9gwR0g21NF1Jsyduzo9rHgC/Q= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4/go.mod h1:dYvTNAggxDZy6y1AF7YDwXsPuHFy/VNEpEI/2dWK9IU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 h1:AplLJCtIaUZDCbr6+gLYdsYNxne4iuaboJhVt9d+WXI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3/go.mod h1:ify42Rb7nKeDDPkFjKn7q1bPscVPu/+gmHH8d2c+anU= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 h1:tEEHn+PGAxRVqMPEhtU8oCSW/1Ge3zP5nUgPrGQNUPs= @@ -119,14 +113,12 @@ github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7 h1:RoinUS4OHD/GFpXV2Jvu2 github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7/go.mod h1:fV9PzXIIT2xUvf5KXEGToDYxEXcqDyO33SRfv2rAs/8= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1 h1:6VwY6q6RZwxZTTTXjDmS8qbeBKvWwp8ugMKCEBjdgWA= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1/go.mod h1:th8fks2kW4FFCUKUQenuEG9TEzMLVxeL0ckdJn/QVbI= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 h1:sXs+JjIwgKA27t+5O8YgXl0cmZpEmctyDVO5y6cMdqA= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9/go.mod h1:CpWhQvomfSbbrfUhq9sq/w2x4wbkQOAqGJbcPS2AINA= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 h1:TNRPtVMfBVk24DL3on3aCSVaEbkLJkVewen+ag01Y5E= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1/go.mod h1:f+2AxSfO44KOyp+hsuDsjJyZmaOQxkcmGKRFExyHZdU= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 h1:3EaaGPAkwUHVbDKx/TCTAubBUqV8F6++5EaiSiXQgN0= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0/go.mod h1:a+PVnn9VNPzPVUiXKXDHK21PSi/TzEKQNIsvSlVXgFY= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5 h1:Bhd9IP8gtuw8JWAsLF7KR9sVQ4mbw/jHe2FKG5MS2kU= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.27.5/go.mod h1:7KdI1o605B1NKFzhsexTUfwneh2zdxFmIhgTZoKLBLo= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.3 h1:+rRHEftLPmqpgTVIhJg69E4WqpdW62jCpIAGvRwtxYA= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.3/go.mod h1:1ujrFMokNtwDv3fwb9RBwdeXS+RonpIeV9uh19GJoH8= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3/go.mod h1:BiglbKCG56L8tmMnUEyEQo422BO9xnNR8vVHnOsByf8= github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0 h1:OMzx7qC+hOYJoQYq7RnYkjgCnKTsdIcEM08AUtsXH6A= @@ -164,8 +156,8 @@ github.com/aws/aws-sdk-go-v2/service/kms v1.18.18 h1:VEj0VdYbmx12y3GKWSXm8hB/mPu github.com/aws/aws-sdk-go-v2/service/kms v1.18.18/go.mod h1:kZodDPTQjSH/qM6/OvyTfM5mms5JHB/EKYp5dhn/vI4= github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4 h1:d1Olp+josNRAlrrtacghtos74rffKS6Mq5gEUBHfgHw= github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4/go.mod h1:XiSHsT7z5ScD2AsTgfa1UEFQaAr53dHP1oWvaqSW6jQ= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4 h1:56esBN+m4kQrGPHZfE60PqfXDryuv8oYbSAc0aU1F10= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4/go.mod h1:2Azx9xDn2nuX+yv4wTR7MO5EYqJNXt2fUC/axUV67qI= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2 h1:HwLseszN4BX8bbibqfBs+oyAHWb2vFoYQi0P5tPq+74= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2/go.mod h1:QHhacFfqWSaj5/N+gPShKlg0V+hsvhnCCtH575tsW3E= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= github.com/aws/aws-sdk-go-v2/service/rds v1.30.1 h1:/B3GswjV+ScqZSZnhs3NMLwvVFXb1/aQL/elQwo0CMM= @@ -174,16 +166,17 @@ github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5 h1:ufl4QI+6Vuxg6E8UOFVy+Ce github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5/go.mod h1:U8V+thdAH44/2weiprIA0JyDWa2XBov58TtdjCTTpc8= github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 h1:OKQIQ0QhEBmGr2LfT952meIZz3ujrPYnxH+dO/5ldnI= github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1/go.mod h1:NffjpNsMUFXp6Ok/PahrktAncoekWrywvmIK83Q2raE= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 h1:YQ7/6UE9h6dIHMjHFr4xXLMZDfhwtQUea/D18XAjhcE= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2/go.mod h1:2WSFojT6r+rKQ+3kn3Ss3MGlbR6BwdfsUsk4L/Lrn14= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2 h1:rJPd7ZUwHSJnUUMwZYYQ5diw2En+8Glx9XAwNSyGyTM= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2/go.mod h1:qzLepVh/MNcSxD5o88id3Rt83nBOKDlV6lAMjoSCAHk= github.com/aws/aws-sdk-go-v2/service/sns v1.18.3 h1:cEFSVrEnbjco0dkcejv7wand04RFaexRdEwbNd1zxCo= github.com/aws/aws-sdk-go-v2/service/sns v1.18.3/go.mod h1:2cPUjR63iE9MPMPJtSyzYmsTFCNrN/Xi9j0v9BL5OU0= github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12 h1:uiG0JUqcL9w3IUu+tLG/BWJSUUhTgzkMVGThM2wDES4= github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12/go.mod h1:DKX/7/ZiAzHO6p6AhArnGdrV4r+d461weby8KeVtvC4= -github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 h1:+5UPNk83hM6HZiHOhZa4hbFIzkVPVsSeaPGWE4lmodk= -github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2/go.mod h1:bE/ToM6K9X5ETp8zaLZf+4JxzXrnk2fNcDoYil4aetg= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= +github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0 h1:hrbnozmShh4n0ar1Zk7Ol0ST1sep1ECGHLwbdbfAFRo= +github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0/go.mod h1:5tNnH3XNzW2Jo3TXQjKKH/Ivx7gRsz9nGcvGhq6YPRA= github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 h1:V47N5eKgVZoRSvx2+RQ0EpAEit/pqOhqeSQFiS4OFEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.2/go.mod h1:/pE21vno3q1h4bbhUOEi+6Zu/aT26UK2WKkDXd+TssQ= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 h1:XFJ2Z6sNUUcAz9poj+245DMkrHE4h2j5I9/xD50RHfE= From ee54c733c8a90051b06858e080c404b329a2d1c0 Mon Sep 17 00:00:00 2001 From: Azanul Date: Tue, 28 Nov 2023 22:54:03 +0530 Subject: [PATCH 03/41] fix: go.mod Signed-off-by: Azanul --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 953b45b02..40d641a64 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3 github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 + github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.4 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0 diff --git a/go.sum b/go.sum index 1dcfbd603..bc9b2c209 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3 h1:rGqIKTmugpZ7lEzXTmbiP github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3/go.mod h1:A7i1lQClkFz09enKv5WYKb8a2lf9QeeI1s9dNiym3hg= github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 h1:WJt83aWld986AxwJpzE0eDqQi18a/PwZ36y7DqENYdk= github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2/go.mod h1:wIuYBSC8G7HHXK/T6YO0t/m463ssur9aMLnycNvKXqQ= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.4 h1:ojxirFFJN39ar+tHiz84PuaeKA/Z3BiopdhxOGGQD4A= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.32.4/go.mod h1:1ujrFMokNtwDv3fwb9RBwdeXS+RonpIeV9uh19GJoH8= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 h1:O6ff5PwwgQ7QkL/XA0H+0U0mWwjkYaP9tHvbr0Ptqak= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2/go.mod h1:kuVxCbsxbP/h6YTT2BfOj4s/bwXYsG3C/8Qn9gO5QJY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 h1:nZPVFkGojUUJupKJzaCKE07LaFDO3Tto1U69F8JipsI= From f5a00f8563ceaf63c01a5f3212132e1acbba8b8f Mon Sep 17 00:00:00 2001 From: Azanul Date: Wed, 29 Nov 2023 19:03:46 +0530 Subject: [PATCH 04/41] fix: incorrect costexplorerOutputList Signed-off-by: Azanul --- providers/aws/aws.go | 52 ++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index bed7daefa..7f81e3982 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -117,28 +117,42 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } costexplorerClient := costexplorer.NewFromConfig(*client.AWSClient) - costexplorerOutput, err := costexplorerClient.GetCostAndUsage(ctx, &costexplorer.GetCostAndUsageInput{ - Granularity: "DAILY", - Metrics: []string{"UnblendedCost"}, - TimePeriod: &types.DateInterval{ - Start: aws.String(utils.BeginningOfMonth(time.Now()).Format("2006-01-02")), - End: aws.String(time.Now().Format("2006-01-02")), - }, - GroupBy: []types.GroupDefinition{ - { - Key: aws.String("SERVICE"), - Type: "DIMENSION", + costexplorerOutputList := []*costexplorer.GetCostAndUsageOutput{} + var nextPageToken *string + for { + costexplorerOutput, err := costexplorerClient.GetCostAndUsage(ctx, &costexplorer.GetCostAndUsageInput{ + Granularity: "DAILY", + Metrics: []string{"UnblendedCost"}, + TimePeriod: &types.DateInterval{ + Start: aws.String(utils.BeginningOfMonth(time.Now()).Format("2006-01-02")), + End: aws.String(time.Now().Format("2006-01-02")), }, - { - Key: aws.String("REGION"), - Type: "DIMENSION", + GroupBy: []types.GroupDefinition{ + { + Key: aws.String("SERVICE"), + Type: "DIMENSION", + }, + { + Key: aws.String("REGION"), + Type: "DIMENSION", + }, }, - }, - }) - if err != nil { - log.Warn("Couldn't fetch cost and usage data:", err) + NextPageToken: nextPageToken, + }) + if err != nil { + log.Warn("Couldn't fetch cost and usage data:", err) + break + } + + costexplorerOutputList = append(costexplorerOutputList, costexplorerOutput) + + if aws.ToString(costexplorerOutput.NextPageToken) == "" { + break + } + + nextPageToken = costexplorerOutput.NextPageToken } - ctxWithCostexplorerOutput := context.WithValue(ctx, awsUtils.CostexplorerKey, costexplorerOutput) + ctxWithCostexplorerOutput := context.WithValue(ctx, awsUtils.CostexplorerKey, costexplorerOutputList) for _, region := range listOfSupportedRegions { c := client.AWSClient.Copy() c.Region = region From ad3d1054d559fa8051e41519cbac995dd85875aa Mon Sep 17 00:00:00 2001 From: Azanul Date: Mon, 4 Dec 2023 12:37:38 +0530 Subject: [PATCH 05/41] refactor: util for reuse Signed-off-by: Azanul --- providers/aws/lambda/functions.go | 26 +------------------------- providers/aws/utils/utils.go | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/providers/aws/lambda/functions.go b/providers/aws/lambda/functions.go index 201a6a969..7ab13e6e8 100644 --- a/providers/aws/lambda/functions.go +++ b/providers/aws/lambda/functions.go @@ -3,7 +3,6 @@ package lambda import ( "context" "fmt" - "strconv" "time" log "github.com/sirupsen/logrus" @@ -11,7 +10,6 @@ import ( "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" @@ -34,7 +32,7 @@ func Functions(ctx context.Context, client providers.ProviderClient) ([]models.R cloudwatchClient := cloudwatch.NewFromConfig(*client.AWSClient) lambdaClient := lambda.NewFromConfig(*client.AWSClient) - serviceCost, err := getLambdaCostAndUsage(ctx, client.AWSClient.Region) + serviceCost, err := awsUtils.GetCostAndUsage(ctx, client.AWSClient.Region, "Lambda") if err != nil { log.Warnln("Couldn't fetch Lambda cost and usage:", err) } @@ -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 { diff --git a/providers/aws/utils/utils.go b/providers/aws/utils/utils.go index ccb9dcc66..bcec79e9a 100644 --- a/providers/aws/utils/utils.go +++ b/providers/aws/utils/utils.go @@ -1,10 +1,12 @@ package utils import ( + "context" "encoding/json" "fmt" "strconv" + "github.com/aws/aws-sdk-go-v2/service/costexplorer" "github.com/aws/aws-sdk-go-v2/service/pricing" ) @@ -14,6 +16,28 @@ const ( CostexplorerKey AWSCtxKey = iota ) +func GetCostAndUsage(ctx context.Context, region string, svcName string) (float64, error) { + total := 0.0 + costexplorerOutputList, ok := ctx.Value(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] == svcName && v.Keys[1] == region { + amt, err := strconv.ParseFloat(*v.Metrics["UnblendedCost"].Amount, 64) + if err != nil { + return 0, err + } + total += amt + } + } + } + } + return total, nil +} + type ProductEntry struct { Product struct { Attributes struct { From 629df9a1db5cf795e252ff28d9f0de552ef8d76c Mon Sep 17 00:00:00 2001 From: tanbirali Date: Thu, 16 Nov 2023 10:52:47 +0530 Subject: [PATCH 06/41] fix(1205): Resource fetching performance improvement for OVH --- internal/internal.go | 2 +- providers/ovh/ovh.go | 36 +++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/internal/internal.go b/internal/internal.go index f8554dcab..c2be726a8 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -256,7 +256,7 @@ func triggerFetchingWorfklow(ctx context.Context, client providers.ProviderClien case "GCP": gcp.FetchResources(ctx, client, db, telemetry, analytics, wp) case "OVH": - ovh.FetchResources(ctx, client, db, telemetry, analytics) + ovh.FetchResources(ctx, client, db, telemetry, analytics, wp) } } diff --git a/providers/ovh/ovh.go b/providers/ovh/ovh.go index 057658f17..11c264741 100644 --- a/providers/ovh/ovh.go +++ b/providers/ovh/ovh.go @@ -42,24 +42,26 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { - for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][OVH] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { + wp.SubmitTask(func() { + for _, fetchResources := range listOfSupportedServices() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][OVH] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "OVH", + "resources": len(resources), + }) } - } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "OVH", - "resources": len(resources), - }) } } - } + }) } From d344687477ec35aad961f1c83a92b1e2a4c66f4b Mon Sep 17 00:00:00 2001 From: Jake Page <38757612+jakepage91@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:25:16 +0000 Subject: [PATCH 07/41] Update civo.mdx update to test mintlify workflow --- docs/configuration/cloud-providers/civo.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/cloud-providers/civo.mdx b/docs/configuration/cloud-providers/civo.mdx index 34047578a..886713146 100644 --- a/docs/configuration/cloud-providers/civo.mdx +++ b/docs/configuration/cloud-providers/civo.mdx @@ -83,7 +83,7 @@ token="yourProductionApiTokenHere" file="komiser.db ``` -### Watch Civo integration tutorial +### Watch the Civo integration tutorial
Date: Tue, 21 Nov 2023 22:37:43 +0530 Subject: [PATCH 08/41] fix: Resource fetching performance improvement for Scaleway (#1212) Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- internal/internal.go | 2 +- providers/scaleway/scaleway.go | 36 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/internal/internal.go b/internal/internal.go index c2be726a8..859adf2f3 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -250,7 +250,7 @@ func triggerFetchingWorfklow(ctx context.Context, client providers.ProviderClien case "Azure": azure.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Scaleway": - scaleway.FetchResources(ctx, client, db, telemetry, analytics) + scaleway.FetchResources(ctx, client, db, telemetry, analytics, wp) case "MongoDBAtlas": mongodbatlas.FetchResources(ctx, client, db, telemetry, analytics, wp) case "GCP": diff --git a/providers/scaleway/scaleway.go b/providers/scaleway/scaleway.go index 212e94038..7ad09d926 100644 --- a/providers/scaleway/scaleway.go +++ b/providers/scaleway/scaleway.go @@ -28,24 +28,26 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { - for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][Scaleway] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { + wp.SubmitTask(func() { + for _, fetchResources := range listOfSupportedServices() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][Scaleway] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "Scaleway", + "resources": len(resources), + }) } - } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "Scaleway", - "resources": len(resources), - }) } } - } + }) } From 70a12314aee81b6e379322189cd2239d17fd30e5 Mon Sep 17 00:00:00 2001 From: Bishal Das <70086051+bishal7679@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:57:29 +0530 Subject: [PATCH 09/41] [KOM-38]: Resource fetching performance improvement for CIVO, DigitalOcean, OCI, Linode, K8s, Tencent (#1215) * making fetching resources parallelized for all providers Signed-off-by: bishal7679 * updating fetching resources for civo and tencent Signed-off-by: bishal7679 --------- Signed-off-by: bishal7679 Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- internal/internal.go | 12 ++++----- providers/civo/civo.go | 34 ++++++++++++------------ providers/digitalocean/digitalocean.go | 36 ++++++++++++++------------ providers/k8s/k8s.go | 34 ++++++++++++------------ providers/linode/linode.go | 36 ++++++++++++++------------ providers/oci/oci.go | 34 ++++++++++++------------ providers/tencent/tencent.go | 34 ++++++++++++------------ 7 files changed, 116 insertions(+), 104 deletions(-) diff --git a/internal/internal.go b/internal/internal.go index 859adf2f3..388488bf3 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -236,17 +236,17 @@ func triggerFetchingWorfklow(ctx context.Context, client providers.ProviderClien case "AWS": aws.FetchResources(ctx, client, regions, db, telemetry, analytics, wp) case "DigitalOcean": - do.FetchResources(ctx, client, db, telemetry, analytics) + do.FetchResources(ctx, client, db, telemetry, analytics, wp) case "OCI": - oci.FetchResources(ctx, client, db, telemetry, analytics) + oci.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Civo": - civo.FetchResources(ctx, client, db, telemetry, analytics) + civo.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Kubernetes": - k8s.FetchResources(ctx, client, db, telemetry, analytics) + k8s.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Linode": - linode.FetchResources(ctx, client, db, telemetry, analytics) + linode.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Tencent": - tencent.FetchResources(ctx, client, db, telemetry, analytics) + tencent.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Azure": azure.FetchResources(ctx, client, db, telemetry, analytics, wp) case "Scaleway": diff --git a/providers/civo/civo.go b/providers/civo/civo.go index 3a64e690f..80f050f33 100644 --- a/providers/civo/civo.go +++ b/providers/civo/civo.go @@ -28,7 +28,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { regions, err := client.CivoClient.ListRegions() if err != nil { @@ -43,23 +43,25 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, db *bu client.CivoClient = clientWithRegion - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][Civo] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost, relations=EXCLUDED.relations").Exec(context.Background()) - if err != nil { - log.WithError(err).Errorf("db trigger failed") + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][Civo] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost, relations=EXCLUDED.relations").Exec(context.Background()) + if err != nil { + log.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "Civo", + "resources": len(resources), + }) } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "Civo", - "resources": len(resources), - }) - } - } + }) } } } diff --git a/providers/digitalocean/digitalocean.go b/providers/digitalocean/digitalocean.go index b9eef09b4..1e9013f56 100644 --- a/providers/digitalocean/digitalocean.go +++ b/providers/digitalocean/digitalocean.go @@ -30,25 +30,27 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][DigitalOcean] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") - } + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][DigitalOcean] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "DigitalOcean", + "resources": len(resources), + }) + } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "DigitalOcean", - "resources": len(resources), - }) - } - } + }) } } diff --git a/providers/k8s/k8s.go b/providers/k8s/k8s.go index 60226960b..d162e4cd1 100644 --- a/providers/k8s/k8s.go +++ b/providers/k8s/k8s.go @@ -28,24 +28,26 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][K8s] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err = db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][K8s] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err = db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "K8s", + "resources": len(resources), + }) } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "K8s", - "resources": len(resources), - }) - } - } + }) } } diff --git a/providers/linode/linode.go b/providers/linode/linode.go index 0d6eaa3c7..50a1b243d 100644 --- a/providers/linode/linode.go +++ b/providers/linode/linode.go @@ -9,11 +9,11 @@ import ( "github.com/tailwarden/komiser/providers" "github.com/tailwarden/komiser/providers/linode/compute" + "github.com/tailwarden/komiser/providers/linode/lkepool" "github.com/tailwarden/komiser/providers/linode/networking" "github.com/tailwarden/komiser/providers/linode/postgres" "github.com/tailwarden/komiser/providers/linode/sql" "github.com/tailwarden/komiser/providers/linode/storage" - "github.com/tailwarden/komiser/providers/linode/lkepool" "github.com/uptrace/bun" ) @@ -32,24 +32,26 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][Linode] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][Linode] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "Linode", + "resources": len(resources), + }) } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "Linode", - "resources": len(resources), - }) - } - } + }) } } diff --git a/providers/oci/oci.go b/providers/oci/oci.go index 3ea31bb2e..44dbdd272 100644 --- a/providers/oci/oci.go +++ b/providers/oci/oci.go @@ -27,24 +27,26 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][OCI] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err = db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Errorf("db trigger failed") + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][OCI] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err = db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Errorf("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "OCI", + "resources": len(resources), + }) } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "OCI", - "resources": len(resources), - }) - } - } + }) } } diff --git a/providers/tencent/tencent.go b/providers/tencent/tencent.go index 6075964cc..440415d40 100644 --- a/providers/tencent/tencent.go +++ b/providers/tencent/tencent.go @@ -20,7 +20,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { } } -func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics) { +func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { regions, err := client.TencentClient.DescribeRegionsWithContext(ctx, tccvm.NewDescribeRegionsRequest()) if err != nil { @@ -37,23 +37,25 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, db *bu client.TencentClient = clientWithRegion - resources, err := fetchResources(ctx, client) - if err != nil { - log.Printf("[%s][Tencent] %s", client.Name, err) - } else { - for _, resource := range resources { - _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) - if err != nil { - logrus.WithError(err).Error("db trigger failed") + wp.SubmitTask(func() { + resources, err := fetchResources(ctx, client) + if err != nil { + log.Printf("[%s][Tencent] %s", client.Name, err) + } else { + for _, resource := range resources { + _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) + if err != nil { + logrus.WithError(err).Error("db trigger failed") + } + } + if telemetry { + analytics.TrackEvent("discovered_resources", map[string]interface{}{ + "provider": "Tencent", + "resources": len(resources), + }) } } - if telemetry { - analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "Tencent", - "resources": len(resources), - }) - } - } + }) } } } From 9f818e959fa8319121ef22290289dd0b444ff1d7 Mon Sep 17 00:00:00 2001 From: Azanul Haque <42029519+Azanul@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:01:40 +0530 Subject: [PATCH 10/41] fix: no OVH in docs (#1218) Signed-off-by: Azanul --- docs/configuration/cloud-providers/ovh.mdx | 22 +++++++++++++++------- docs/mint.json | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/configuration/cloud-providers/ovh.mdx b/docs/configuration/cloud-providers/ovh.mdx index dbf84489c..6d7b2b387 100644 --- a/docs/configuration/cloud-providers/ovh.mdx +++ b/docs/configuration/cloud-providers/ovh.mdx @@ -6,13 +6,21 @@ sidebar_label: OVHcloud - - Compute Instances - - Container Registries - - Databases - - Functions - - Kubernetes Clusters - - Load Balancers - - Serverless Containers + - Alerts + - Images + - Compute Instances + - Kubernetes Clusters + - Kubernetes Nodes + - IPs + - Networks + - Vracks + - Projects + - SSHKeys + - SSLCertificates + - SSLGateways + - Storage Containers + - Storage Volumes + - Users diff --git a/docs/mint.json b/docs/mint.json index ba6c1ada4..fa36ecf5f 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -71,7 +71,7 @@ }, { "group": "Configuration", - "pages": [{"group": "Cloud Providers", "pages": ["configuration/cloud-providers/aws", "configuration/cloud-providers/azure", "configuration/cloud-providers/civo", "configuration/cloud-providers/digital-ocean", "configuration/cloud-providers/k8s", "configuration/cloud-providers/linode", "configuration/cloud-providers/tencent", "configuration/cloud-providers/scaleway", "configuration/cloud-providers/mongodb-atlas", "configuration/cloud-providers/gcp", "configuration/cloud-providers/oracle"]}] + "pages": [{"group": "Cloud Providers", "pages": ["configuration/cloud-providers/aws", "configuration/cloud-providers/azure", "configuration/cloud-providers/civo", "configuration/cloud-providers/digital-ocean", "configuration/cloud-providers/k8s", "configuration/cloud-providers/linode", "configuration/cloud-providers/tencent", "configuration/cloud-providers/scaleway", "configuration/cloud-providers/mongodb-atlas", "configuration/cloud-providers/gcp", "configuration/cloud-providers/oracle", "configuration/cloud-providers/ovh"]}] }, { "group": "Guides", From 6b03062f034bec180b099d7d089481f6f23e25d7 Mon Sep 17 00:00:00 2001 From: Avinesh Tripathi <73980067+AvineshTripathi@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:04:19 +0530 Subject: [PATCH 11/41] Update hello-to-new-contributors.yml --- .github/workflows/hello-to-new-contributors.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hello-to-new-contributors.yml b/.github/workflows/hello-to-new-contributors.yml index a7a5ae505..ca022a1b1 100644 --- a/.github/workflows/hello-to-new-contributors.yml +++ b/.github/workflows/hello-to-new-contributors.yml @@ -4,7 +4,7 @@ on: issues: types: - opened - pull_request: + pull_request_target: types: - opened jobs: @@ -17,4 +17,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-message: "Hey, thank you for opening your first Issue! ๐Ÿ™‚ While a Tailwarden team member takes a look at your issue we would like to invite you to join our official Discord server, where you can interact directly with other contributors and Tailwarden team members. Link here: https://discord.tailwarden.com" - pr-message: "Hey, thank you for opening your Pull Request ! ๐Ÿ™‚ While a Tailwarden team member takes a look at your PR we would like to invite you to join our official Discord server, where you can interact directly with other contributors and Tailwarden team members. Link here: https://discord.tailwarden.com" \ No newline at end of file + pr-message: "Hey, thank you for opening your Pull Request ! ๐Ÿ™‚ While a Tailwarden team member takes a look at your PR we would like to invite you to join our official Discord server, where you can interact directly with other contributors and Tailwarden team members. Link here: https://discord.tailwarden.com" From e656f97c2857a8a372e1ffbdfc74669383ba6dcb Mon Sep 17 00:00:00 2001 From: Umar Abid <75561750+umrkhn@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:11:31 +0500 Subject: [PATCH 12/41] [FEAT-1092]: Update color names and box-shadows to match Design-System (#1143) * feat: update colors in tailwind config * fix: update color class-names to match new palette * fix: update primary & secondary color class-names to match new palette * fix: update box-shadows to match design system * fix: update tailwind config and class-names --- .../account-details/AwsAccountDetails.tsx | 6 +- .../account-details/AzureAccountDetails.tsx | 4 +- .../account-details/CivoAccountDetails.tsx | 4 +- .../DigitalOceanAccountDetails.tsx | 4 +- .../account-details/GcpAccountDetails.tsx | 4 +- .../KubernetesAccountDetails.tsx | 4 +- .../account-details/LinodeAccountDetails.tsx | 4 +- .../MongoDBAtlasAccountDetails.tsx | 4 +- .../account-details/OciAccountDetails.tsx | 4 +- .../ScalewayAccountDetails.tsx | 4 +- .../account-details/TencentAccountDetails.tsx | 4 +- dashboard/components/banner/Banner.tsx | 6 +- dashboard/components/button/Button.tsx | 12 +- dashboard/components/card/Card.tsx | 6 +- dashboard/components/card/CardSkeleton.tsx | 6 +- dashboard/components/checkbox/Checkbox.tsx | 2 +- .../components/CloudAccountDeleteContents.tsx | 2 +- .../components/CloudAccountItem.tsx | 10 +- .../components/CloudAccountsHeader.tsx | 2 +- .../components/CloudAccountsLayout.tsx | 8 +- .../components/CloudAccountsSidePanel.tsx | 8 +- .../dashboard/components/DashboardLayout.tsx | 2 +- .../cloud-map/DashboardCloudMapCard.tsx | 12 +- .../cloud-map/DashboardCloudMapError.tsx | 10 +- .../cloud-map/DashboardCloudMapSkeleton.tsx | 16 +- .../cloud-map/DashboardCloudMapTooltip.tsx | 4 +- .../DashboardCostExplorerCard.tsx | 6 +- .../DashboardCostExplorerError.tsx | 24 +-- .../DashboardCostExplorerSkeleton.tsx | 32 ++-- .../DashboardResourcesManagerCard.tsx | 8 +- .../DashboardResourcesManagerError.tsx | 24 +-- .../DashboardResourcesManagerSkeleton.tsx | 26 +-- .../top-stats/DashboardTopStatsError.tsx | 2 +- .../components/empty-state/EmptyState.tsx | 4 +- .../components/error-state/ErrorState.tsx | 4 +- .../components/explorer/DependencyGraph.tsx | 10 +- .../explorer/DependencyGraphError.tsx | 8 +- .../explorer/DependencyGraphSkeleton.tsx | 4 +- .../explorer/DependencyGraphWrapper.tsx | 8 +- .../filter/DependencyGraphFilterDropdown.tsx | 4 +- .../filter/DependencyGraphFilterSummary.tsx | 4 +- .../filter/DependendencyGraphFilter.tsx | 10 +- .../feedback-widget/FeedbackWidget.tsx | 19 +- .../components/icons/ClearFilterIcon.tsx | 2 +- dashboard/components/input/Input.tsx | 8 +- .../components/InventoryActiveFilters.tsx | 10 +- .../components/InventoryFilterDropdown.tsx | 4 +- .../inventory/components/InventoryHeader.tsx | 2 +- .../inventory/components/InventoryLayout.tsx | 14 +- .../components/InventorySearchBar.tsx | 2 +- .../components/InventorySearchNoResults.tsx | 4 +- .../components/InventorySidePanel.tsx | 34 ++-- .../components/InventoryStatsCards.tsx | 24 +-- .../inventory/components/InventoryTable.tsx | 4 +- .../components/InventoryTableBulkActions.tsx | 2 +- .../components/InventoryTableRow.tsx | 4 +- .../components/InventoryTableTags.tsx | 14 +- .../filter/InventoryFilterBreadcrumbs.tsx | 14 +- .../filter/InventoryFilterSummary.tsx | 4 +- .../components/view/InventoryView.tsx | 16 +- .../components/view/InventoryViewHeader.tsx | 12 +- .../InventoryViewAlertsChooseAlertMethod.tsx | 12 +- .../alerts/InventoryViewAlertsDeleteAlert.tsx | 6 +- .../alerts/InventoryViewAlertsDisplay.tsx | 6 +- .../alerts/InventoryViewAlertsEditAlert.tsx | 36 ++-- .../view/alerts/InventoryViewAlertsError.tsx | 4 +- .../alerts/InventoryViewAlertsHasNoAlerts.tsx | 4 +- .../alerts/InventoryViewAlertsSkeleton.tsx | 10 +- dashboard/components/layout/Layout.tsx | 2 +- dashboard/components/modal/Modal.tsx | 4 +- dashboard/components/navbar/Navbar.tsx | 16 +- .../components/number-input/NumberInput.tsx | 8 +- .../DatabaseErrorMessage.tsx | 2 +- .../onboarding-wizard/DatabasePurplin.tsx | 2 +- .../onboarding-wizard/InputFileSelect.tsx | 12 +- .../onboarding-wizard/LabelledInput.tsx | 4 +- .../OnboardingWizardLayout.tsx | 4 +- .../onboarding-wizard/ProgressBar.tsx | 2 +- .../onboarding-wizard/ProviderContent.tsx | 2 +- .../onboarding-wizard/SelectInput.tsx | 14 +- .../select-checkbox/SelectCheckbox.tsx | 30 ++-- dashboard/components/select/Select.tsx | 16 +- dashboard/components/sidepanel/Sidepanel.tsx | 4 +- .../components/sidepanel/SidepanelHeader.tsx | 8 +- .../components/sidepanel/SidepanelPage.tsx | 2 +- .../components/sidepanel/SidepanelTabs.tsx | 6 +- .../components/skeleton/SkeletonFilters.tsx | 8 +- .../components/skeleton/SkeletonInventory.tsx | 14 +- .../components/skeleton/SkeletonStats.tsx | 6 +- dashboard/components/template/Template.tsx | 2 +- dashboard/components/toast/Toast.tsx | 16 +- dashboard/components/tooltip/Tooltip.tsx | 2 +- dashboard/components/upload/Upload.tsx | 10 +- dashboard/pages/cloud-accounts.tsx | 2 +- .../pages/onboarding/choose-database.tsx | 6 +- .../pages/onboarding/cloud-accounts/index.tsx | 66 +++---- dashboard/pages/onboarding/complete.tsx | 2 +- dashboard/tailwind.config.js | 169 +++++++++++++----- 98 files changed, 562 insertions(+), 480 deletions(-) diff --git a/dashboard/components/account-details/AwsAccountDetails.tsx b/dashboard/components/account-details/AwsAccountDetails.tsx index b64bcecc5..fe0e829ad 100644 --- a/dashboard/components/account-details/AwsAccountDetails.tsx +++ b/dashboard/components/account-details/AwsAccountDetails.tsx @@ -103,7 +103,7 @@ function AwsAccountDetails({
@@ -117,7 +117,7 @@ function AwsAccountDetails({ values={options.map(option => option.value)} /> {[options[2].value, options[3].value].includes(credentialType) && ( -
+
{credentialType === options[3].value ? 'Komiser will fetch the credentials from AWS' : 'Komiser will load credentials from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.'} @@ -180,7 +180,7 @@ function AwsAccountDetails({ )}
{hasError && ( -
+
We couldn't connect to your AWS account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/AzureAccountDetails.tsx b/dashboard/components/account-details/AzureAccountDetails.tsx index 19cfe0652..3799a7690 100644 --- a/dashboard/components/account-details/AzureAccountDetails.tsx +++ b/dashboard/components/account-details/AzureAccountDetails.tsx @@ -27,7 +27,7 @@ function AzureAccountDetails({
{hasError && ( -
+
We couldn't connect to your Azure account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/CivoAccountDetails.tsx b/dashboard/components/account-details/CivoAccountDetails.tsx index 1d8fb3a7e..274d12466 100644 --- a/dashboard/components/account-details/CivoAccountDetails.tsx +++ b/dashboard/components/account-details/CivoAccountDetails.tsx @@ -27,7 +27,7 @@ function CivoAccountDetails({
{hasError && ( -
+
We couldn't connect to your Civo account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/DigitalOceanAccountDetails.tsx b/dashboard/components/account-details/DigitalOceanAccountDetails.tsx index 4db9ad4b1..1ad505cd4 100644 --- a/dashboard/components/account-details/DigitalOceanAccountDetails.tsx +++ b/dashboard/components/account-details/DigitalOceanAccountDetails.tsx @@ -27,7 +27,7 @@ function DigitalOceanAccountDetails({
{hasError && ( -
+
We couldn't connect to your Digital Ocean account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/GcpAccountDetails.tsx b/dashboard/components/account-details/GcpAccountDetails.tsx index 366a64180..f83c61029 100644 --- a/dashboard/components/account-details/GcpAccountDetails.tsx +++ b/dashboard/components/account-details/GcpAccountDetails.tsx @@ -60,7 +60,7 @@ function GcpAccountDetails({
@@ -83,7 +83,7 @@ function GcpAccountDetails({
{hasError && ( -
+
We couldn't connect to your GCP account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/KubernetesAccountDetails.tsx b/dashboard/components/account-details/KubernetesAccountDetails.tsx index b906a66cd..1699edcfd 100644 --- a/dashboard/components/account-details/KubernetesAccountDetails.tsx +++ b/dashboard/components/account-details/KubernetesAccountDetails.tsx @@ -83,7 +83,7 @@ function KubernetesAccountDetails({
{hasError && ( -
+
We couldn't connect to your Kubernetes account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/LinodeAccountDetails.tsx b/dashboard/components/account-details/LinodeAccountDetails.tsx index 200c9e5ab..ad63de8ea 100644 --- a/dashboard/components/account-details/LinodeAccountDetails.tsx +++ b/dashboard/components/account-details/LinodeAccountDetails.tsx @@ -26,7 +26,7 @@ function LinodeAccountDetails({
{hasError && ( -
+
We couldn't connect to your Linode account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/MongoDBAtlasAccountDetails.tsx b/dashboard/components/account-details/MongoDBAtlasAccountDetails.tsx index 31b6dbfbf..24a669a53 100644 --- a/dashboard/components/account-details/MongoDBAtlasAccountDetails.tsx +++ b/dashboard/components/account-details/MongoDBAtlasAccountDetails.tsx @@ -26,7 +26,7 @@ function MongoDbAtlasAccountDetails({
{hasError && ( -
+
We couldn't connect to your MongoDB Atlas account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/OciAccountDetails.tsx b/dashboard/components/account-details/OciAccountDetails.tsx index 1cd052786..37fa56678 100644 --- a/dashboard/components/account-details/OciAccountDetails.tsx +++ b/dashboard/components/account-details/OciAccountDetails.tsx @@ -60,7 +60,7 @@ function OciAccountDetails({
@@ -83,7 +83,7 @@ function OciAccountDetails({
{hasError && ( -
+
We couldn't connect to your OCI account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/ScalewayAccountDetails.tsx b/dashboard/components/account-details/ScalewayAccountDetails.tsx index 3152a2b69..384ae864d 100644 --- a/dashboard/components/account-details/ScalewayAccountDetails.tsx +++ b/dashboard/components/account-details/ScalewayAccountDetails.tsx @@ -26,7 +26,7 @@ function ScalewayAccountDetails({
{hasError && ( -
+
We couldn't connect to your Scaleway account. Please check if the file is correct.
diff --git a/dashboard/components/account-details/TencentAccountDetails.tsx b/dashboard/components/account-details/TencentAccountDetails.tsx index e3a3cd513..abdaeebad 100644 --- a/dashboard/components/account-details/TencentAccountDetails.tsx +++ b/dashboard/components/account-details/TencentAccountDetails.tsx @@ -26,7 +26,7 @@ function TencentAccountDetails({
{hasError && ( -
+
We couldn't connect to your Tencent account. Please check if the file is correct.
diff --git a/dashboard/components/banner/Banner.tsx b/dashboard/components/banner/Banner.tsx index 7f3f78275..ff4e32b04 100644 --- a/dashboard/components/banner/Banner.tsx +++ b/dashboard/components/banner/Banner.tsx @@ -15,7 +15,7 @@ function Banner({ githubStars }: BannerProps) { return (
{formatNumber(githubStars)}
@@ -53,7 +53,7 @@ function Banner({ githubStars }: BannerProps) { @@ -204,11 +204,11 @@ function InventoryView({ {hiddenResources.map(item => ( currentId === item.id) - ? 'border-black-200/70 bg-komiser-120' - : 'border-black-200/30 bg-white hover:bg-black-100/50' + ? 'border-gray-300 bg-darkcyan-100' + : 'border-gray-300 bg-white hover:bg-gray-50' } border-b last:border-none`} > @@ -263,7 +263,7 @@ function InventoryView({ )} {hiddenResources && hiddenResources.length === 0 && ( -
+
-

+

No hidden resources in this view

-

+

To hide a resource from this view, select and hide them on the inventory table.

diff --git a/dashboard/components/inventory/components/view/InventoryViewHeader.tsx b/dashboard/components/inventory/components/view/InventoryViewHeader.tsx index 711731b01..13ef875ce 100644 --- a/dashboard/components/inventory/components/view/InventoryViewHeader.tsx +++ b/dashboard/components/inventory/components/view/InventoryViewHeader.tsx @@ -75,7 +75,7 @@ function InventoryViewHeader({
{currentView && ( <> -
+
{currentView.name}
-
+
{label && ( - + {label} )}
{isValid === false && ( -

{error}

+

{error}

)}
); diff --git a/dashboard/components/onboarding-wizard/DatabaseErrorMessage.tsx b/dashboard/components/onboarding-wizard/DatabaseErrorMessage.tsx index 8939b9b76..297da06f5 100644 --- a/dashboard/components/onboarding-wizard/DatabaseErrorMessage.tsx +++ b/dashboard/components/onboarding-wizard/DatabaseErrorMessage.tsx @@ -1,6 +1,6 @@ function DatabaseErrorMessage() { return ( -
+
We're sorry, but we were unable to connect to your database using the information provided. Please ensure that the information are correct and try again. If you continue to experience issues, please{' '} diff --git a/dashboard/components/onboarding-wizard/DatabasePurplin.tsx b/dashboard/components/onboarding-wizard/DatabasePurplin.tsx index f81391554..5ff1514a1 100644 --- a/dashboard/components/onboarding-wizard/DatabasePurplin.tsx +++ b/dashboard/components/onboarding-wizard/DatabasePurplin.tsx @@ -7,7 +7,7 @@ interface DatabasePurplinProps { function DatabasePurplin({ database }: DatabasePurplinProps) { return (
-
+
{subLabel && ( - + {subLabel} )} @@ -68,9 +68,9 @@ function InputFileSelect({ placeholder={placeholder} className={classNames( hasError - ? 'outline-error-600 focus:outline-error-700' - : 'outline-gray-200 focus:outline-primary', - 'block w-full rounded border py-4 pl-5 text-sm text-black-900 outline focus:outline-2 ' + ? 'outline-red-500 focus:outline-red-500' + : 'outline-gray-200 focus:outline-darkcyan-500', + 'block w-full rounded border py-4 pl-5 text-sm text-gray-950 outline focus:outline-2 ' )} onChange={handleInputChange} /> @@ -78,14 +78,14 @@ function InputFileSelect({ {icon && ( )}
{hasError && errorMessage && ( -
+
{errorMessage}
diff --git a/dashboard/components/onboarding-wizard/LabelledInput.tsx b/dashboard/components/onboarding-wizard/LabelledInput.tsx index 2e98f107e..629028be6 100644 --- a/dashboard/components/onboarding-wizard/LabelledInput.tsx +++ b/dashboard/components/onboarding-wizard/LabelledInput.tsx @@ -34,7 +34,7 @@ function LabelledInput({ {subLabel && ( - + {subLabel} )} @@ -53,7 +53,7 @@ function LabelledInput({ disabled={disabled} placeholder={placeholder} required={required} - className={`block w-full rounded py-[14.5px] text-sm text-black-900 outline outline-black-200 focus:outline-2 focus:outline-primary ${ + className={`block w-full rounded py-[14.5px] text-sm text-gray-950 outline outline-gray-300 focus:outline-2 focus:outline-darkcyan-500 ${ icon ? 'pl-10' : 'pl-3' }`} onChange={onChange} diff --git a/dashboard/components/onboarding-wizard/OnboardingWizardLayout.tsx b/dashboard/components/onboarding-wizard/OnboardingWizardLayout.tsx index 1b2d9de58..8c949264d 100644 --- a/dashboard/components/onboarding-wizard/OnboardingWizardLayout.tsx +++ b/dashboard/components/onboarding-wizard/OnboardingWizardLayout.tsx @@ -47,11 +47,11 @@ function RightSideLayout({ return ( <> {isCustom ? ( -
+
{children}
) : ( -
+
{children}
)} diff --git a/dashboard/components/onboarding-wizard/ProgressBar.tsx b/dashboard/components/onboarding-wizard/ProgressBar.tsx index 108d0f876..26ee3c505 100644 --- a/dashboard/components/onboarding-wizard/ProgressBar.tsx +++ b/dashboard/components/onboarding-wizard/ProgressBar.tsx @@ -1,7 +1,7 @@ function OnboardingWizardProgressBar({ width }: { width: string }) { return (
-
+
); } diff --git a/dashboard/components/onboarding-wizard/ProviderContent.tsx b/dashboard/components/onboarding-wizard/ProviderContent.tsx index 94b18a6db..91bdf6711 100644 --- a/dashboard/components/onboarding-wizard/ProviderContent.tsx +++ b/dashboard/components/onboarding-wizard/ProviderContent.tsx @@ -55,7 +55,7 @@ export default function ProviderContent({
adding an {providerName} account to Komiser. diff --git a/dashboard/components/onboarding-wizard/SelectInput.tsx b/dashboard/components/onboarding-wizard/SelectInput.tsx index 913854a39..d634a5f96 100644 --- a/dashboard/components/onboarding-wizard/SelectInput.tsx +++ b/dashboard/components/onboarding-wizard/SelectInput.tsx @@ -38,7 +38,7 @@ function SelectInput({
{icon}
@@ -49,11 +49,11 @@ function SelectInput({
diff --git a/dashboard/components/select/Select.tsx b/dashboard/components/select/Select.tsx index 969a96518..d05ae8d1c 100644 --- a/dashboard/components/select/Select.tsx +++ b/dashboard/components/select/Select.tsx @@ -28,22 +28,22 @@ function Select({
@@ -54,7 +54,7 @@ function Select({ onClick={toggle} className="fixed inset-0 z-20 hidden animate-fade-in bg-transparent opacity-0 sm:block" >
-
+
{values.map((item, idx) => { const isActive = value === item; @@ -62,8 +62,8 @@ function Select({
-

+

{title}

diff --git a/dashboard/components/sidepanel/SidepanelPage.tsx b/dashboard/components/sidepanel/SidepanelPage.tsx index 124fbe6e3..3fe551318 100644 --- a/dashboard/components/sidepanel/SidepanelPage.tsx +++ b/dashboard/components/sidepanel/SidepanelPage.tsx @@ -18,7 +18,7 @@ function SidepanelPage({ {page === param && (
{children}
diff --git a/dashboard/components/sidepanel/SidepanelTabs.tsx b/dashboard/components/sidepanel/SidepanelTabs.tsx index 5b40e4d9d..01e9b5d28 100644 --- a/dashboard/components/sidepanel/SidepanelTabs.tsx +++ b/dashboard/components/sidepanel/SidepanelTabs.tsx @@ -8,7 +8,7 @@ export type SidepanelTabsProps = { function SidepanelTabs({ goTo, page, tabs }: SidepanelTabsProps) { return ( -
+
    {tabs.map((tab, idx) => (
  • @@ -17,8 +17,8 @@ function SidepanelTabs({ goTo, page, tabs }: SidepanelTabsProps) { className={`inline-block cursor-pointer select-none rounded-t-lg border-b-2 px-2 py-4 sm:p-4 ${ page === tab.toLowerCase() - ? 'border-komiser-600 text-komiser-600 hover:text-komiser-600' - : 'border-transparent hover:text-komiser-700' + ? 'border-darkcyan-500 text-darkcyan-500 hover:text-darkcyan-500' + : 'border-transparent hover:text-darkcyan-700' }`} > {capitalizeString(tab)} {/* capitalize first letter */} diff --git a/dashboard/components/skeleton/SkeletonFilters.tsx b/dashboard/components/skeleton/SkeletonFilters.tsx index a97721ef5..ae1b260e3 100644 --- a/dashboard/components/skeleton/SkeletonFilters.tsx +++ b/dashboard/components/skeleton/SkeletonFilters.tsx @@ -1,10 +1,10 @@ function SkeletonFilters() { return (
    -
    Filters
    -
    -
    -
    +
    Filters
    +
    +
    +
    ); diff --git a/dashboard/components/skeleton/SkeletonInventory.tsx b/dashboard/components/skeleton/SkeletonInventory.tsx index e6f8a0bfd..2074afb54 100644 --- a/dashboard/components/skeleton/SkeletonInventory.tsx +++ b/dashboard/components/skeleton/SkeletonInventory.tsx @@ -9,13 +9,13 @@ function SkeletonInventory() { className="flex h-[57px] items-center border-b bg-white px-6 text-sm" >
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    ))} diff --git a/dashboard/components/skeleton/SkeletonStats.tsx b/dashboard/components/skeleton/SkeletonStats.tsx index 0df8609e3..a4b4db7c0 100644 --- a/dashboard/components/skeleton/SkeletonStats.tsx +++ b/dashboard/components/skeleton/SkeletonStats.tsx @@ -17,10 +17,10 @@ function SkeletonStats({ NumOfCards = 3 }) { className="flex h-[7.5rem] animate-pulse items-center rounded-lg bg-white px-6 text-sm" >
    -
    +
    -
    -
    +
    +
diff --git a/dashboard/components/template/Template.tsx b/dashboard/components/template/Template.tsx index aa6a64604..aa511df10 100644 --- a/dashboard/components/template/Template.tsx +++ b/dashboard/components/template/Template.tsx @@ -4,7 +4,7 @@ export type TemplateProps = { function Template({ sampleTextProp }: TemplateProps) { return ( -
+
{sampleTextProp}
); diff --git a/dashboard/components/toast/Toast.tsx b/dashboard/components/toast/Toast.tsx index 4a4ccc702..1e4fca092 100644 --- a/dashboard/components/toast/Toast.tsx +++ b/dashboard/components/toast/Toast.tsx @@ -19,10 +19,10 @@ function Toast({ hasError, title, message, dismissToast }: ToastProp) { <>
@@ -30,16 +30,16 @@ function Toast({ hasError, title, message, dismissToast }: ToastProp) { className={classNames( 'absolute bottom-0 left-0 h-1 animate-width-to-fit', { - 'bg-error-600/60': hasError, - 'bg-success-600/60': !hasError + 'bg-red-50': hasError, + 'bg-green-500': !hasError } )} >
{hasError ? ( @@ -51,7 +51,7 @@ function Toast({ hasError, title, message, dismissToast }: ToastProp) {

{title}

diff --git a/dashboard/components/tooltip/Tooltip.tsx b/dashboard/components/tooltip/Tooltip.tsx index 7fdec818a..eb9c1035e 100644 --- a/dashboard/components/tooltip/Tooltip.tsx +++ b/dashboard/components/tooltip/Tooltip.tsx @@ -20,7 +20,7 @@ function Tooltip({ )} @@ -198,7 +200,7 @@ function Upload({

{file.name}

-

+

{(file.size / (1024 * 1024)).toFixed(2)} MB

@@ -280,7 +282,7 @@ function Upload({

{(fileOrFiles as File).name}

-

+

{((fileOrFiles as File).size / (1024 * 1024)).toFixed(2)} MB

diff --git a/dashboard/pages/cloud-accounts.tsx b/dashboard/pages/cloud-accounts.tsx index 79be7073b..7164ccdb9 100644 --- a/dashboard/pages/cloud-accounts.tsx +++ b/dashboard/pages/cloud-accounts.tsx @@ -126,7 +126,7 @@ function CloudAccounts() { {/* Delete Modal */} closeRemoveModal()}> -
+
{cloudAccountItem && ( Add cloud account @@ -72,24 +72,24 @@ export default function CloudAccounts() { {cloudAccounts.map(account => (
-

+

{account.name}

-

+

{platform.getLabel(account.provider)}

))}
-
+
@@ -112,68 +112,68 @@ export default function CloudAccounts() {
-
+
{/* Row 2 */}
-
-
-
+
+
+
-
-
+
+
{/* Row 3 */} -
-
-
+
+
+
-
-
+
+
-
+
{/* Row 4 */}
-
-
-
+
+
+
-
+
{/* Row 5 */} -
-
-
-
-
+
+
+
+
+
-
+
{/* Row 6 */}
-
-
+
+
-
+
@@ -181,7 +181,7 @@ export default function CloudAccounts() {
-
+
@@ -190,7 +190,7 @@ export default function CloudAccounts() { closeRemoveModal()}> -
+
{cloudAccountItem && ( -

+

Your data is being synced

diff --git a/dashboard/tailwind.config.js b/dashboard/tailwind.config.js index a90bf1875..236ac5349 100644 --- a/dashboard/tailwind.config.js +++ b/dashboard/tailwind.config.js @@ -6,51 +6,132 @@ module.exports = { './components/**/*.{js,ts,jsx,tsx}' ], theme: { - extend: { - colors: { - primary: '#008484', - secondary: '#065555', - komiser: { - 100: '#F5FDFD', - 120: '#e5f8f8', - 130: '#E2F6F6', - 150: '#DFF5F5', - 200: '#CCF2F2', - 300: '#99E5E5', - 400: '#66D9D9', - 500: '#33CCCC', - 600: '#008484', - 700: '#065555' - }, - info: { - 600: '#387BEB' - }, - warning: { - 100: '#FFF5DA', - 600: '#EDC16B' - }, - error: { - 100: '#FFE8E8', - 600: '#DE5E5E', - 700: '#ae4242', - 900: '#362033' - }, - success: { - 100: '#E1FFE3', - 600: '#56BA5B' - }, - black: { - 100: '#F4F9F9', - 130: '#F4F2F7', - 150: '#F5F5F5', - 170: '#EDEBEE', - 200: '#CFD7D7', - 300: '#95A3A3', - 400: '#697372', - 800: '#0C1717', - 900: '#070011' - } + colors: { + inherit: 'inherit', + transparent: 'transparent', + current: 'currentColor', + black: '#000000', + white: '#FFFFFF', + cyan: { + 50: '#ECFAFA', + 100: '#DFF5F5', + 200: '#CCF2F2', + 300: '#99E5E5', + 400: '#66D9D9', + 500: '#33CCCC', + 600: '#2AA7A7', + 700: '#208282', + 800: '#175D5D', + 900: '#0E3838', + 950: '#051313' + }, + darkcyan: { + 50: '#EDFAFA', + 100: '#E2F6F6', + 200: '#B6EAEA', + 300: '#63CBCB', + 400: '#2EA8A8', + 500: '#008484', + 600: '#006D6E', + 700: '#065555', + 800: '#004344', + 900: '#002E2F', + 950: '#00191A' + }, + gray: { + 50: '#F4F9F9', + 100: '#F4F2F7', + 200: '#EDEBEE', + 300: '#CFD7D7', + 400: '#B3BDBD', + 500: '#95A3A3', + 600: '#7F8B8B', + 700: '#697372', + 800: '#515959', + 900: '#3A4040', + 950: '#0C1717' }, + red: { + 50: '#FFE8E8', + 100: '#F7D1D1', + 200: '#F2BABA', + 300: '#EDA3A3', + 400: '#E37575', + 500: '#DE5E5E', + 600: '#BF4F4F', + 700: '#9D4040', + 800: '#7B3131', + 900: '#592222', + 950: '#371313' + }, + green: { + 50: '#EEFDEE', + 100: '#E1FFE3', + 200: '#CAF5CA', + 300: '#A3E7A6', + 400: '#81CF84', + 500: '#56BA5B', + 600: '#489E4E', + 700: '#3B8240', + 800: '#2E6632', + 900: '#214A24', + 950: '#142E16' + }, + orange: { + 50: '#FFF8EB', + 100: '#FFF5DA', + 200: '#FCE0AC', + 300: '#F6C879', + 400: '#ECAD4E', + 500: '#ED8F2B', + 600: '#D5721F', + 700: '#A85924', + 800: '#844B2A', + 900: '#664029', + 950: '#422D24' + }, + blue: { + 50: '#E8EFFD', + 100: '#D4E4FF', + 200: '#ACC7F7', + 300: '#72A1F1', + 400: '#558EEE', + 500: '#387BEB', + 600: '#2F69C6', + 700: '#2656A3', + 800: '#1D4380', + 900: '#14305D', + 950: '#0B1D3A' + }, + purple: { + 50: '#F7F6FE', + 100: '#EDE8FC', + 200: '#E0DBFB', + 300: '#C9BDF4', + 400: '#AF99EA', + 500: '#9470E0', + 600: '#8157C5', + 700: '#714DA6', + 800: '#5F4585', + 900: '#4B3966', + 950: '#372B4A' + }, + background: { + DEFAULT: '#F2FFFF', + base: '#F2F7F8', + disabled: '#EFEDF1', + ds: '#F5F5F5' /* ds => design-system */ + }, + komiser: { + dark: '#009999' + } + }, + boxShadow: { + right: '2px 4px 8px 0px rgba(105, 115, 114, 0.16)', + left: '-2px 4px 8px 0px rgba(105, 115, 114, 0.16)', + none: '0 0 #0000' + }, + extend: { fontFamily: { sans: [ 'Noto Sans', From 74a8a0bfc78ae734e9cbd8d59b87fa88ed2091c9 Mon Sep 17 00:00:00 2001 From: Richwin <39644816+AmalRichwin@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:05:46 +0530 Subject: [PATCH 13/41] feat: add aws codebuild resource (#1216) Co-authored-by: amal richwin Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- go.mod | 91 ++++++++++----------- go.sum | 121 +++++++++++++++++++++++----- providers/aws/aws.go | 2 + providers/aws/codebuild/projects.go | 68 ++++++++++++++++ 4 files changed, 216 insertions(+), 66 deletions(-) create mode 100644 providers/aws/codebuild/projects.go diff --git a/go.mod b/go.mod index 7c46e0ce3..86a002bee 100644 --- a/go.mod +++ b/go.mod @@ -18,32 +18,32 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 github.com/BurntSushi/toml v1.2.1 - github.com/aws/aws-sdk-go-v2 v1.21.0 - github.com/aws/aws-sdk-go-v2/config v1.18.27 - github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2 - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7 - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1 - github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0 - github.com/aws/aws-sdk-go-v2/service/ecr v1.17.20 - github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26 - github.com/aws/aws-sdk-go-v2/service/efs v1.19.0 - github.com/aws/aws-sdk-go-v2/service/eks v1.21.4 - github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.1 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.4 - github.com/aws/aws-sdk-go-v2/service/iam v1.18.9 - github.com/aws/aws-sdk-go-v2/service/kinesis v1.17.12 - github.com/aws/aws-sdk-go-v2/service/kms v1.18.18 - github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4 - github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 - github.com/aws/aws-sdk-go-v2/service/rds v1.30.1 - github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5 - github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 - github.com/aws/aws-sdk-go-v2/service/sns v1.18.3 - github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12 - github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 + github.com/aws/aws-sdk-go-v2 v1.23.0 + github.com/aws/aws-sdk-go-v2/config v1.25.3 + github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1 + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2 + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 + github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 + github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0 + github.com/aws/aws-sdk-go-v2/service/ecs v1.33.1 + github.com/aws/aws-sdk-go-v2/service/efs v1.23.2 + github.com/aws/aws-sdk-go-v2/service/eks v1.33.1 + github.com/aws/aws-sdk-go-v2/service/elasticache v1.32.2 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.24.2 + github.com/aws/aws-sdk-go-v2/service/iam v1.27.2 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.22.2 + github.com/aws/aws-sdk-go-v2/service/kms v1.26.2 + github.com/aws/aws-sdk-go-v2/service/lambda v1.48.0 + github.com/aws/aws-sdk-go-v2/service/pricing v1.23.2 + github.com/aws/aws-sdk-go-v2/service/rds v1.63.0 + github.com/aws/aws-sdk-go-v2/service/redshift v1.37.0 + github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0 + github.com/aws/aws-sdk-go-v2/service/sns v1.25.2 + github.com/aws/aws-sdk-go-v2/service/sqs v1.28.1 + github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 github.com/civo/civogo v0.3.24 github.com/digitalocean/godo v1.97.0 github.com/elazarl/go-bindata-assetfs v1.0.1 @@ -83,7 +83,7 @@ require ( require ( cloud.google.com/go/longrunning v0.4.1 // indirect github.com/apache/arrow/go/v11 v11.0.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/google/s2a-go v0.1.4 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect @@ -99,24 +99,25 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 // indirect github.com/andybalholm/brotli v1.0.4 // indirect github.com/apache/thrift v0.16.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 // indirect - github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4 - github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 - github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 - github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect - github.com/aws/smithy-go v1.14.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.2 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 + github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2 + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 // indirect + github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2 + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2 + github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0 + github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 // indirect + github.com/aws/smithy-go v1.17.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect diff --git a/go.sum b/go.sum index de970de02..c89e729d5 100644 --- a/go.sum +++ b/go.sum @@ -70,17 +70,24 @@ github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3eP github.com/aws/aws-sdk-go-v2 v1.17.8/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= +github.com/aws/aws-sdk-go-v2 v1.23.0 h1:PiHAzmiQQr6JULBUdvR8fKlA+UPKLT/8KbiqpFBWiAo= +github.com/aws/aws-sdk-go-v2 v1.23.0/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3/go.mod h1:gNsR5CaXKmQSSzrmGxmwmct/r+ZBfbxorAuXYsj/M5Y= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= -github.com/aws/aws-sdk-go-v2/config v1.18.27/go.mod h1:0My+YgmkGxeqjXZb5BYme5pc4drjTnM+x1GJ3zv42Nw= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RKyZrOPO3V4DobiTUk= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 h1:ZY3108YtBNq96jNZTICHxN1gSBSbnvIdYwwqnvCV4Mc= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1/go.mod h1:t8PYl/6LzdAqsU4/9tz28V/kU+asFePvpOMkdul0gEQ= +github.com/aws/aws-sdk-go-v2/config v1.25.2 h1:+Gy7Xe372Tw/PiUw3We94Le9IwU1tmJqCD6cvI4oBJM= +github.com/aws/aws-sdk-go-v2/config v1.25.2/go.mod h1:6hFlwWQiVOUG0Ej2ql0tG4zPlpDH++HD0WT1MA6l5Q4= +github.com/aws/aws-sdk-go-v2/config v1.25.3 h1:E4m9LbwJOoncDNt3e9MPLbz/saxWcGUlZVBydydD6+8= +github.com/aws/aws-sdk-go-v2/config v1.25.3/go.mod h1:tAByZy03nH5jcq0vZmkcVoo6tRzRHEwSFx3QW4NmDw8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.1 h1:WessyrdgyFN5TB+eLQdrFSlN/3oMnqukIFhDxK6z8h0= +github.com/aws/aws-sdk-go-v2/credentials v1.16.1/go.mod h1:RQJyPxKcr+m4ArlIG1LUhMOrjposVfzbX6H8oR6oCgE= +github.com/aws/aws-sdk-go-v2/credentials v1.16.2 h1:0sdZ5cwfOAipTzZ7eOL0gw4LAhk/RZnTa16cDqIt8tg= +github.com/aws/aws-sdk-go-v2/credentials v1.16.2/go.mod h1:sDdvGhXrSVT5yzBDR7qXz+rhbpiMpUYfF3vJ01QSdrc= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 h1:9wKDWEjwSnXZre0/O3+ZwbBl1SmlgWYBbrTV10X/H1s= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4/go.mod h1:t4i+yGHMCcUNIX1x7YVYa6bH/Do7civ5I6cG/6PMfyA= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14/go.mod h1:kdjrMwHwrC3+FsKhNcCMJ7tUVj/8uSD5CZXeQ4wV6fM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= @@ -89,8 +96,9 @@ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1B github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32/go.mod h1:RudqOgadTWdcS3t/erPQo24pcVEoYyqj/kKW5Vya21I= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 h1:DUwbD79T8gyQ23qVXFUthjzVMTviSHi3y4z58KvghhM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3/go.mod h1:7sGSz1JCKHWWBHq98m6sMtWQikmYPpxjqOydDemiVoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= @@ -99,90 +107,161 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3F github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26/go.mod h1:vq86l7956VgFr0/FWQ2BWnK07QC3WYsepKzy33qqY5U= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 h1:AplLJCtIaUZDCbr6+gLYdsYNxne4iuaboJhVt9d+WXI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3/go.mod h1:ify42Rb7nKeDDPkFjKn7q1bPscVPu/+gmHH8d2c+anU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 h1:tEEHn+PGAxRVqMPEhtU8oCSW/1Ge3zP5nUgPrGQNUPs= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5/go.mod h1:aIwFF3dUk95ocCcA3zfk3nhz0oLkpzHFWuMp8l/4nNs= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 h1:lMwCXiWJlrtZot0NJTjbC8G9zl+V3i68gBTBBvDeEXA= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3/go.mod h1:5yzAuE9i2RkVAttBl8yxZgQr5OCq4D5yDnG7j9x2L0U= github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0 h1:INMBcLcEY29u2ZHMnva693HZNCwzO6v42d92HOCk5DA= github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0/go.mod h1:6UIKOkbI/NjVEszKrlgWDrlEPkpd2X+BBrzj0N/XTM4= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2 h1:OMs7hocjXtsg5GQms82w7sMX4XphhYtdtY10+HUOAUw= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2/go.mod h1:4zAwZ67VQMYHhFLTasOY+G7DNEu+NEralz+ZLv05puA= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2 h1:Awy7wwCzPl3Iluer4ZiiV04wtMpr8LSpSIp6NGdRJDA= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2/go.mod h1:7LoDeLxZ3C6iVnr7YTMyHAjzV+XY01gYrTB2n6hfqAk= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1 h1:2awLldJ8gWgB2lW/ywilHLgGzs06vYb69OjelFQVi2w= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1/go.mod h1:6NGYQhD5ky3wERvkhdhnFk7RKCg3nidKqE6DOEZgGgg= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7 h1:RoinUS4OHD/GFpXV2Jvu27xqDFLMx4ZFclo2WDw7D8Q= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7/go.mod h1:fV9PzXIIT2xUvf5KXEGToDYxEXcqDyO33SRfv2rAs/8= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2 h1:xlG5GdoesjSp4seJ1utZhhfF7spdP1o5WjViLY9VZzY= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2/go.mod h1:c66twOpDFT+AYQ8LloFNY+VbwcM9SqwrrdDboMKo6tg= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1 h1:6VwY6q6RZwxZTTTXjDmS8qbeBKvWwp8ugMKCEBjdgWA= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1/go.mod h1:th8fks2kW4FFCUKUQenuEG9TEzMLVxeL0ckdJn/QVbI= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 h1:T2YjSwrDkLg2laNjhIunyTbjy9Qzd/oZ+yQjrAhdIEA= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2/go.mod h1:GuVYdn7tWjbyp/YtZSM6VczmceUUQW6v8Yq98wJ9dWY= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 h1:sXs+JjIwgKA27t+5O8YgXl0cmZpEmctyDVO5y6cMdqA= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9/go.mod h1:CpWhQvomfSbbrfUhq9sq/w2x4wbkQOAqGJbcPS2AINA= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 h1:TNRPtVMfBVk24DL3on3aCSVaEbkLJkVewen+ag01Y5E= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1/go.mod h1:f+2AxSfO44KOyp+hsuDsjJyZmaOQxkcmGKRFExyHZdU= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2 h1:7CP1OWPNk3sLQe5eockBr1l8N5prgO7oDuYO+bNNUrI= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2/go.mod h1:lad97CcvLKXfU5uWV/9S3QrHUwk6CBDounq7rNs9K0E= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 h1:3EaaGPAkwUHVbDKx/TCTAubBUqV8F6++5EaiSiXQgN0= github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0/go.mod h1:a+PVnn9VNPzPVUiXKXDHK21PSi/TzEKQNIsvSlVXgFY= +github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 h1:WJt83aWld986AxwJpzE0eDqQi18a/PwZ36y7DqENYdk= +github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2/go.mod h1:wIuYBSC8G7HHXK/T6YO0t/m463ssur9aMLnycNvKXqQ= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3/go.mod h1:BiglbKCG56L8tmMnUEyEQo422BO9xnNR8vVHnOsByf8= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 h1:O6ff5PwwgQ7QkL/XA0H+0U0mWwjkYaP9tHvbr0Ptqak= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2/go.mod h1:kuVxCbsxbP/h6YTT2BfOj4s/bwXYsG3C/8Qn9gO5QJY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0 h1:OMzx7qC+hOYJoQYq7RnYkjgCnKTsdIcEM08AUtsXH6A= github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0/go.mod h1:VoBcwURHnJVCWuXHdqVuG03i2lUlHJ5DTTqDSyCdEcc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 h1:nZPVFkGojUUJupKJzaCKE07LaFDO3Tto1U69F8JipsI= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0/go.mod h1:xYJZQIo/YZxEbeBxUYRQJTCJ924EuKtDfrhVx76yzOE= github.com/aws/aws-sdk-go-v2/service/ecr v1.17.20 h1:nJnXfQggNZdrWz/0cm2ZGyddGK+FqTiN4QJGanzKZoY= github.com/aws/aws-sdk-go-v2/service/ecr v1.17.20/go.mod h1:kEVGiy2tACP0cegVqx4MrjsgQMSgrtgRq1fSa+Ix6F0= +github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0 h1:GXzeEnCzcbBTCyXunqPApkkya0+lUBFB3IvyH8383pY= +github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0/go.mod h1:/ioOZzYo15EL987AAdsmYWKpta8Rokosh5Iax9B6DPg= github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26 h1:EHJAYkUnlFJ/KwuFMvUs/bPbb0DaqAI+gTfXxffTPZ0= github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26/go.mod h1:NpR78BP2STxvF/R1GXLDM4gAEfjz68W/h0nC5b6Jk3s= +github.com/aws/aws-sdk-go-v2/service/ecs v1.33.1 h1:TozC9N4YIy3daojW5RoutyW0dIBCQvTtMXKDM7cSvW8= +github.com/aws/aws-sdk-go-v2/service/ecs v1.33.1/go.mod h1:twzaZjxQJVIuJBlk/PCQ/El6rwvxcCQ2uiO/5BguYHg= github.com/aws/aws-sdk-go-v2/service/efs v1.19.0 h1:3kuyykZ/ttISUeCeCRa7QBLIknnerNNDYLrAzYAYVjM= github.com/aws/aws-sdk-go-v2/service/efs v1.19.0/go.mod h1:5MfwGfNzP7d86CrJKNCk7jawZLgBzO4N+X1q/4eYNN8= +github.com/aws/aws-sdk-go-v2/service/efs v1.23.2 h1:+Bal9jUaFSjYjiJkoE0eiqCvmknCboCvSCESznszsrQ= +github.com/aws/aws-sdk-go-v2/service/efs v1.23.2/go.mod h1:raG1iL/vkJ+4nVtmrc4PgmwH0JgZp5NBOcWFf9GBRJY= github.com/aws/aws-sdk-go-v2/service/eks v1.21.4 h1:qmKWieiIiYwD46GRD6nxFc1KsyR0ChGRid8emb7rDEY= github.com/aws/aws-sdk-go-v2/service/eks v1.21.4/go.mod h1:Th2+t6mwi0bZayXUOFOTuyWR2nwRUVcadDy4WGE8C2E= +github.com/aws/aws-sdk-go-v2/service/eks v1.33.1 h1:zRB7CTeejJmBpdpzrBkciNLMpg8T+06EvGA/H4Kkvcw= +github.com/aws/aws-sdk-go-v2/service/eks v1.33.1/go.mod h1:23btAyMrfTvG2zh/3+CZJ1c2eYWiVWP6tPRJwC67sk8= github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.1 h1:QltBKgs6pvGwUDek4LQp51iKY3OVPr/3id24pmbAITM= github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.1/go.mod h1:gnN6CtMag9be9XGXsMenh084NcSy5pO0hriEYz/TERk= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.32.2 h1:3V4GHH05PtNsDjXlKXVbIw0vSjSNUQoPQEtILns4BMs= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.32.2/go.mod h1:p5/Vq+5NiyqnyQyH5JVK3lrHDygbiQiqdCNaDT018I8= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.4 h1:INLSLWNqukSFWYJs8Ejw3jlTLHCUiqQ90tOVXBvhWTY= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.4/go.mod h1:S4aoiQbEwpj9XAgW3Noe8jPArHjW+arHsO6L9t9xbLQ= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.24.2 h1:4pOJ+1slB9s36rDsHvnbUd93SZZ4+Z/FdX5f1TKOiQk= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.24.2/go.mod h1:NatT0jYQo0MfgZnIX8ReNWnbsl4rbQjuS+uci1KNkck= github.com/aws/aws-sdk-go-v2/service/iam v1.18.9 h1:pVHvEz+KIsTwRKufwvGZr90X/YJ7swVshaBZNY4ESIY= github.com/aws/aws-sdk-go-v2/service/iam v1.18.9/go.mod h1:ARVuo+lYC2ibYxny/PKC3maaWKLAg25KSq0dkSkE2WE= +github.com/aws/aws-sdk-go-v2/service/iam v1.27.2 h1:Z3a5I5kKGsuVW4kbrtHVnLGUHpEpo19zFyo6dzP2WCM= +github.com/aws/aws-sdk-go-v2/service/iam v1.27.2/go.mod h1:CYRyr95Q57xVvrcKJu3vw4jVVCZhmY1SyugM+EWXlzI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3/go.mod h1:gkb2qADY+OHaGLKNTYxMaQNacfeyQpZ4csDTQMeFmcw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 h1:dpiPHgmFstgkLG07KaYAewvuptq5kvo52xn7tVSrtrQ= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10/go.mod h1:9cBNUHI2aW4ho0A5T87O294iPDuuUOSIEDjnd1Lq/z0= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 h1:rpkF4n0CyFcrJUG/rNNohoTmhtWlFTRI4BsZOh9PvLs= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1/go.mod h1:l9ymW25HOqymeU2m1gbUQ3rUIsTwKs8gYHXkqDQUhiI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 h1:gVv2vXOMqJeR4ZHHV32K7LElIJIIzyw/RU1b0lSfWTQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9/go.mod h1:EF5RLnD9l0xvEWwMRcktIS/dI6lF8lU5eV3B13k6sWo= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 h1:xbwRyCy7kXrOj89iIKLB6NfE2WCpP9HoKyk8dMDvnIQ= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3/go.mod h1:R+/S1O4TYpcktbVwddeOYg+uwUfLhADP2S/x4QwsCTM= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 h1:V03dAtcAN4Qtly7H3/0B6m3t/cyl4FgyKFqK738fyJw= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19/go.mod h1:2WpVWFC5n4DYhjNXzObtge8xfgId9UP6GWca46KJFLo= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.3 h1:AakYQhCXteXSRHebRAGDKf/P+3kmEWwiyE3Um/d0ecg= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.3/go.mod h1:wt1Ib9UX0A8fxifnkYLrv7RAlg+ziPR8Fo0NqzuJkHI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8/go.mod h1:rDVhIMAX9N2r8nWxDUlbubvvaFMnfsm+3jAV7q+rpM4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.19/go.mod h1:02CP6iuYP+IVnBX5HULVdSAku/85eHB2Y9EsFhrkEwU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 h1:kJOolE8xBAD13xTCgOakByZkyP4D/owNmvEiioeUNAg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3/go.mod h1:Owv1I59vaghv1Ax8zz8ELY8DN7/Y0rGS+WWAmjgi950= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 h1:TlN1UC39A0LUNoD51ubO5h32haznA+oVe15jO9O4Lj0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8/go.mod h1:JlVwmWtT/1c5W+6oUsjXjAJ0iJZ+hlghdrDy/8JxGCU= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 h1:KV0z2RDc7euMtg8aUT1czv5p29zcLlXALNFsd3jkkEc= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3/go.mod h1:KZgs2ny8HsxRIRbDwgvJcHHBZPOzQr/+NtGwnP+w2ec= github.com/aws/aws-sdk-go-v2/service/kinesis v1.17.12 h1:Xw1u2pxSAI9giCqYamjNZjFthuh2UjVct8mnv9X2XBo= github.com/aws/aws-sdk-go-v2/service/kinesis v1.17.12/go.mod h1:DDgzScy4XhYf4xgHP7xVNP3jjwMwMegzusy8awGN7YU= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.22.2 h1:kav618UT9BH3kNhEXWo5YPphWBzcxLHp/VKmgXXqM34= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.22.2/go.mod h1:pDjJUf6yTIRPsSLDdVI2oR6A9Iv12P1NOL5KaJ9AeRI= github.com/aws/aws-sdk-go-v2/service/kms v1.18.18 h1:VEj0VdYbmx12y3GKWSXm8hB/mPuSaYHnECRhokHy4Wo= github.com/aws/aws-sdk-go-v2/service/kms v1.18.18/go.mod h1:kZodDPTQjSH/qM6/OvyTfM5mms5JHB/EKYp5dhn/vI4= +github.com/aws/aws-sdk-go-v2/service/kms v1.26.2 h1:cd6qixgKwsu4i1oT14brIYx9qZaXX/9CFrBncxYr7OY= +github.com/aws/aws-sdk-go-v2/service/kms v1.26.2/go.mod h1:SBBCPcfsuNkvXnW4sDzoPNeow6xOaU6g2xTfj1dfxo4= github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4 h1:d1Olp+josNRAlrrtacghtos74rffKS6Mq5gEUBHfgHw= github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4/go.mod h1:XiSHsT7z5ScD2AsTgfa1UEFQaAr53dHP1oWvaqSW6jQ= +github.com/aws/aws-sdk-go-v2/service/lambda v1.48.0 h1:Q1ajPX+B64b/OyxuaSDBjqOMmVrpNLhPfTFghpU783k= +github.com/aws/aws-sdk-go-v2/service/lambda v1.48.0/go.mod h1:80TuTBIg7+OWOOA85SdMfvV393HGXPwqoepFTQn6/qA= github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4 h1:56esBN+m4kQrGPHZfE60PqfXDryuv8oYbSAc0aU1F10= github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4/go.mod h1:2Azx9xDn2nuX+yv4wTR7MO5EYqJNXt2fUC/axUV67qI= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2 h1:HwLseszN4BX8bbibqfBs+oyAHWb2vFoYQi0P5tPq+74= +github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2/go.mod h1:QHhacFfqWSaj5/N+gPShKlg0V+hsvhnCCtH575tsW3E= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= +github.com/aws/aws-sdk-go-v2/service/pricing v1.23.2 h1:EMIsBk8ansD+Fs5Fdl3iFL0Cf9Y++68psfK4Owhbga8= +github.com/aws/aws-sdk-go-v2/service/pricing v1.23.2/go.mod h1:UzuiXD0+X63VTTdvwpSwyhBhnwAygld8Ll/gMT6kAOI= github.com/aws/aws-sdk-go-v2/service/rds v1.30.1 h1:/B3GswjV+ScqZSZnhs3NMLwvVFXb1/aQL/elQwo0CMM= github.com/aws/aws-sdk-go-v2/service/rds v1.30.1/go.mod h1:wPFe1Cj3nZWmNWKKdkXw961l1dJheTZQ5JjPImqbMuI= +github.com/aws/aws-sdk-go-v2/service/rds v1.63.0 h1:Mb6mn6mRfTpI2WEZkLmmJ7jtiPHKzwJ8otzUA5rIq+o= +github.com/aws/aws-sdk-go-v2/service/rds v1.63.0/go.mod h1:C73+OVOdaMZNc/Z8PhnLoArk6mCqxkiqfgmCrvNrDDM= github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5 h1:ufl4QI+6Vuxg6E8UOFVy+CeCtXS+gBMb00oTh2qSPco= github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5/go.mod h1:U8V+thdAH44/2weiprIA0JyDWa2XBov58TtdjCTTpc8= +github.com/aws/aws-sdk-go-v2/service/redshift v1.37.0 h1:h/XTWZNIkMTNZFjnmIRHr+p6BT9esREmacvlXTNfK5w= +github.com/aws/aws-sdk-go-v2/service/redshift v1.37.0/go.mod h1:s7X0SVket1YMB6VRzilG1F8k/wQSMgfCL5BYA5d7C04= github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 h1:OKQIQ0QhEBmGr2LfT952meIZz3ujrPYnxH+dO/5ldnI= github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1/go.mod h1:NffjpNsMUFXp6Ok/PahrktAncoekWrywvmIK83Q2raE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0 h1:cwTuq73Tv6jtNJIMgTDKsih5O2YsVrKGpg20H98tbmo= +github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0/go.mod h1:NXRKkiRF+erX2hnybnVU660cYT5/KChRD4iUgJ97cI8= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 h1:YQ7/6UE9h6dIHMjHFr4xXLMZDfhwtQUea/D18XAjhcE= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2/go.mod h1:2WSFojT6r+rKQ+3kn3Ss3MGlbR6BwdfsUsk4L/Lrn14= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2 h1:rJPd7ZUwHSJnUUMwZYYQ5diw2En+8Glx9XAwNSyGyTM= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2/go.mod h1:qzLepVh/MNcSxD5o88id3Rt83nBOKDlV6lAMjoSCAHk= github.com/aws/aws-sdk-go-v2/service/sns v1.18.3 h1:cEFSVrEnbjco0dkcejv7wand04RFaexRdEwbNd1zxCo= github.com/aws/aws-sdk-go-v2/service/sns v1.18.3/go.mod h1:2cPUjR63iE9MPMPJtSyzYmsTFCNrN/Xi9j0v9BL5OU0= +github.com/aws/aws-sdk-go-v2/service/sns v1.25.2 h1:KVWf3qQZxqX0ogLvRfq+uEXfbRexe7Y2JBRQ0TQaxwQ= +github.com/aws/aws-sdk-go-v2/service/sns v1.25.2/go.mod h1:gOyDaoXeBT5gwG0DL+5RFQ7cddwLOablLJdXmWSWdyU= github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12 h1:uiG0JUqcL9w3IUu+tLG/BWJSUUhTgzkMVGThM2wDES4= github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12/go.mod h1:DKX/7/ZiAzHO6p6AhArnGdrV4r+d461weby8KeVtvC4= +github.com/aws/aws-sdk-go-v2/service/sqs v1.28.1 h1:rfX6lA1EW6Q5zT7Cl8RG90hCdWY4VVaobnmbgl5OIy0= +github.com/aws/aws-sdk-go-v2/service/sqs v1.28.1/go.mod h1:gGmF6hmPsYUf/kgaSw7BOqLpdVNSfMzGSar61OX812w= github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 h1:+5UPNk83hM6HZiHOhZa4hbFIzkVPVsSeaPGWE4lmodk= github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2/go.mod h1:bE/ToM6K9X5ETp8zaLZf+4JxzXrnk2fNcDoYil4aetg= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 h1:XFJ2Z6sNUUcAz9poj+245DMkrHE4h2j5I9/xD50RHfE= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/oZqi6NPIhoR+uF7GeMU9eg= +github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0 h1:hrbnozmShh4n0ar1Zk7Ol0ST1sep1ECGHLwbdbfAFRo= +github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0/go.mod h1:5tNnH3XNzW2Jo3TXQjKKH/Ivx7gRsz9nGcvGhq6YPRA= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 h1:V47N5eKgVZoRSvx2+RQ0EpAEit/pqOhqeSQFiS4OFEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.2/go.mod h1:/pE21vno3q1h4bbhUOEi+6Zu/aT26UK2WKkDXd+TssQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.2 h1:sMAcO7VHVw28HTAdZpTULDzFirHOsVm/x25CxhUH0jA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.2/go.mod h1:dWqm5G767qwKPuayKfzm4rjzFmVjiBFbOJrpSPnAMDs= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 h1:/XiEU7VIFcVWRDQLabyrSjBoKIm8UkYgsvWDuFW8Img= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0/go.mod h1:dWqm5G767qwKPuayKfzm4rjzFmVjiBFbOJrpSPnAMDs= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.2 h1:vwyiRTnXLqsak/6WAQ+uTRhVqKI6vxUQ0HJXjKij0zM= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.2/go.mod h1:4EqRHDCKP78hq3zOnmFXu5k0j4bXbRFfCh/zQ6KnEfQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 h1:M2w4kiMGJCCM6Ljmmx/l6mmpfa3gPJVpBencfnsgvqs= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.3/go.mod h1:4EqRHDCKP78hq3zOnmFXu5k0j4bXbRFfCh/zQ6KnEfQ= github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= +github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= diff --git a/providers/aws/aws.go b/providers/aws/aws.go index aa0ba4338..c73cebaea 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -11,6 +11,7 @@ import ( "github.com/tailwarden/komiser/providers/aws/apigateway" "github.com/tailwarden/komiser/providers/aws/cloudfront" "github.com/tailwarden/komiser/providers/aws/cloudwatch" + "github.com/tailwarden/komiser/providers/aws/codebuild" "github.com/tailwarden/komiser/providers/aws/dynamodb" "github.com/tailwarden/komiser/providers/aws/ec2" "github.com/tailwarden/komiser/providers/aws/ecr" @@ -97,6 +98,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { ec2.VpcPeeringConnections, kinesis.Streams, redshift.EventSubscriptions, + codebuild.BuildProjects, } } diff --git a/providers/aws/codebuild/projects.go b/providers/aws/codebuild/projects.go new file mode 100644 index 000000000..14d8d584e --- /dev/null +++ b/providers/aws/codebuild/projects.go @@ -0,0 +1,68 @@ +package codebuild + +import ( + "context" + "fmt" + "time" + + log "github.com/sirupsen/logrus" + + "github.com/aws/aws-sdk-go-v2/aws" + + "github.com/aws/aws-sdk-go-v2/service/codebuild" + "github.com/aws/aws-sdk-go-v2/service/sts" + "github.com/tailwarden/komiser/models" + "github.com/tailwarden/komiser/providers" +) + +func BuildProjects(ctx context.Context, client providers.ProviderClient) ([]models.Resource, error) { + var listProjectsParams codebuild.ListProjectsInput + resources := make([]models.Resource, 0) + codebuildClient := codebuild.NewFromConfig(*client.AWSClient) + stsClient := sts.NewFromConfig(*client.AWSClient) + stsOutput, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) + if err != nil { + return resources, err + } + + accountId := stsOutput.Account + + for { + output, err := codebuildClient.ListProjects(ctx, &listProjectsParams) + if err != nil { + return resources, err + } + + for _, project := range output.Projects { + resourceArn := fmt.Sprintf("arn:aws:codebuild:%s:%s:project/%s", client.AWSClient.Region, *accountId, project) + tags := make([]models.Tag, 0) + + resources = append(resources, models.Resource{ + Provider: "AWS", + Account: client.Name, + Service: "CodeBuild", + ResourceId: resourceArn, + Region: client.AWSClient.Region, + Name: project, + Tags: tags, + FetchedAt: time.Now(), + Link: fmt.Sprintf("https://%s.console.aws.amazon.com/codesuite/codebuild/%s/projects/%s/details?region=%s", client.AWSClient.Region, *accountId, project, client.AWSClient.Region), + }) + } + if aws.ToString(output.NextToken) == "" { + break + } + + listProjectsParams.NextToken = output.NextToken + } + + log.WithFields(log.Fields{ + "provider": "AWS", + "account": client.Name, + "region": client.AWSClient.Region, + "service": "CodeBuild", + "resources": len(resources), + }).Info("Fetched resources") + + return resources, nil +} From a24452b0516b0d1f1e984e1ffd5333c1795e87b5 Mon Sep 17 00:00:00 2001 From: Vanshul Bhatia <98731471+VanshulB@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:06:48 +0530 Subject: [PATCH 14/41] feat: add aws codedeploy resource (#1228) --- go.mod | 7 +- go.sum | 123 ++---------------- providers/aws/aws.go | 2 + providers/aws/codedeploy/deployment_groups.go | 77 +++++++++++ 4 files changed, 91 insertions(+), 118 deletions(-) create mode 100644 providers/aws/codedeploy/deployment_groups.go diff --git a/go.mod b/go.mod index 86a002bee..953b45b02 100644 --- a/go.mod +++ b/go.mod @@ -18,12 +18,13 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 github.com/BurntSushi/toml v1.2.1 - github.com/aws/aws-sdk-go-v2 v1.23.0 + github.com/aws/aws-sdk-go-v2 v1.23.1 github.com/aws/aws-sdk-go-v2/config v1.25.3 github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2 github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1 github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 + github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3 github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 @@ -102,8 +103,8 @@ require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.16.2 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 // indirect github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 diff --git a/go.sum b/go.sum index c89e729d5..1dcfbd603 100644 --- a/go.sum +++ b/go.sum @@ -62,204 +62,98 @@ github.com/apache/arrow/go/v11 v11.0.0 h1:hqauxvFQxww+0mEU/2XHG6LT7eZternCZq+A5Y github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/aws/aws-sdk-go-v2 v1.16.7/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw= -github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw= -github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.8/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= -github.com/aws/aws-sdk-go-v2 v1.23.0 h1:PiHAzmiQQr6JULBUdvR8fKlA+UPKLT/8KbiqpFBWiAo= -github.com/aws/aws-sdk-go-v2 v1.23.0/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3/go.mod h1:gNsR5CaXKmQSSzrmGxmwmct/r+ZBfbxorAuXYsj/M5Y= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= +github.com/aws/aws-sdk-go-v2 v1.23.1 h1:qXaFsOOMA+HsZtX8WoCa+gJnbyW7qyFFBlPqvTSzbaI= +github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 h1:ZY3108YtBNq96jNZTICHxN1gSBSbnvIdYwwqnvCV4Mc= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1/go.mod h1:t8PYl/6LzdAqsU4/9tz28V/kU+asFePvpOMkdul0gEQ= -github.com/aws/aws-sdk-go-v2/config v1.25.2 h1:+Gy7Xe372Tw/PiUw3We94Le9IwU1tmJqCD6cvI4oBJM= -github.com/aws/aws-sdk-go-v2/config v1.25.2/go.mod h1:6hFlwWQiVOUG0Ej2ql0tG4zPlpDH++HD0WT1MA6l5Q4= github.com/aws/aws-sdk-go-v2/config v1.25.3 h1:E4m9LbwJOoncDNt3e9MPLbz/saxWcGUlZVBydydD6+8= github.com/aws/aws-sdk-go-v2/config v1.25.3/go.mod h1:tAByZy03nH5jcq0vZmkcVoo6tRzRHEwSFx3QW4NmDw8= -github.com/aws/aws-sdk-go-v2/credentials v1.16.1 h1:WessyrdgyFN5TB+eLQdrFSlN/3oMnqukIFhDxK6z8h0= -github.com/aws/aws-sdk-go-v2/credentials v1.16.1/go.mod h1:RQJyPxKcr+m4ArlIG1LUhMOrjposVfzbX6H8oR6oCgE= github.com/aws/aws-sdk-go-v2/credentials v1.16.2 h1:0sdZ5cwfOAipTzZ7eOL0gw4LAhk/RZnTa16cDqIt8tg= github.com/aws/aws-sdk-go-v2/credentials v1.16.2/go.mod h1:sDdvGhXrSVT5yzBDR7qXz+rhbpiMpUYfF3vJ01QSdrc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 h1:9wKDWEjwSnXZre0/O3+ZwbBl1SmlgWYBbrTV10X/H1s= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4/go.mod h1:t4i+yGHMCcUNIX1x7YVYa6bH/Do7civ5I6cG/6PMfyA= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14/go.mod h1:kdjrMwHwrC3+FsKhNcCMJ7tUVj/8uSD5CZXeQ4wV6fM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32/go.mod h1:RudqOgadTWdcS3t/erPQo24pcVEoYyqj/kKW5Vya21I= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 h1:DUwbD79T8gyQ23qVXFUthjzVMTviSHi3y4z58KvghhM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3/go.mod h1:7sGSz1JCKHWWBHq98m6sMtWQikmYPpxjqOydDemiVoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26/go.mod h1:vq86l7956VgFr0/FWQ2BWnK07QC3WYsepKzy33qqY5U= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 h1:AplLJCtIaUZDCbr6+gLYdsYNxne4iuaboJhVt9d+WXI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3/go.mod h1:ify42Rb7nKeDDPkFjKn7q1bPscVPu/+gmHH8d2c+anU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 h1:LAm3Ycm9HJfbSCd5I+wqC2S9Ej7FPrgr5CQoOljJZcE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4/go.mod h1:xEhvbJcyUf/31yfGSQBe01fukXwXJ0gxDp7rLfymWE0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 h1:4GV0kKZzUxiWxSVpn/9gwR0g21NF1Jsyduzo9rHgC/Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4/go.mod h1:dYvTNAggxDZy6y1AF7YDwXsPuHFy/VNEpEI/2dWK9IU= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 h1:tEEHn+PGAxRVqMPEhtU8oCSW/1Ge3zP5nUgPrGQNUPs= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5/go.mod h1:aIwFF3dUk95ocCcA3zfk3nhz0oLkpzHFWuMp8l/4nNs= github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 h1:lMwCXiWJlrtZot0NJTjbC8G9zl+V3i68gBTBBvDeEXA= github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3/go.mod h1:5yzAuE9i2RkVAttBl8yxZgQr5OCq4D5yDnG7j9x2L0U= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0 h1:INMBcLcEY29u2ZHMnva693HZNCwzO6v42d92HOCk5DA= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.0/go.mod h1:6UIKOkbI/NjVEszKrlgWDrlEPkpd2X+BBrzj0N/XTM4= github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2 h1:OMs7hocjXtsg5GQms82w7sMX4XphhYtdtY10+HUOAUw= github.com/aws/aws-sdk-go-v2/service/apigateway v1.20.2/go.mod h1:4zAwZ67VQMYHhFLTasOY+G7DNEu+NEralz+ZLv05puA= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2 h1:Awy7wwCzPl3Iluer4ZiiV04wtMpr8LSpSIp6NGdRJDA= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.27.2/go.mod h1:7LoDeLxZ3C6iVnr7YTMyHAjzV+XY01gYrTB2n6hfqAk= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1 h1:2awLldJ8gWgB2lW/ywilHLgGzs06vYb69OjelFQVi2w= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.35.1/go.mod h1:6NGYQhD5ky3wERvkhdhnFk7RKCg3nidKqE6DOEZgGgg= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7 h1:RoinUS4OHD/GFpXV2Jvu27xqDFLMx4ZFclo2WDw7D8Q= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.7/go.mod h1:fV9PzXIIT2xUvf5KXEGToDYxEXcqDyO33SRfv2rAs/8= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2 h1:xlG5GdoesjSp4seJ1utZhhfF7spdP1o5WjViLY9VZzY= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.30.2/go.mod h1:c66twOpDFT+AYQ8LloFNY+VbwcM9SqwrrdDboMKo6tg= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1 h1:6VwY6q6RZwxZTTTXjDmS8qbeBKvWwp8ugMKCEBjdgWA= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.23.1/go.mod h1:th8fks2kW4FFCUKUQenuEG9TEzMLVxeL0ckdJn/QVbI= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 h1:T2YjSwrDkLg2laNjhIunyTbjy9Qzd/oZ+yQjrAhdIEA= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2/go.mod h1:GuVYdn7tWjbyp/YtZSM6VczmceUUQW6v8Yq98wJ9dWY= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9 h1:sXs+JjIwgKA27t+5O8YgXl0cmZpEmctyDVO5y6cMdqA= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.9/go.mod h1:CpWhQvomfSbbrfUhq9sq/w2x4wbkQOAqGJbcPS2AINA= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 h1:TNRPtVMfBVk24DL3on3aCSVaEbkLJkVewen+ag01Y5E= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1/go.mod h1:f+2AxSfO44KOyp+hsuDsjJyZmaOQxkcmGKRFExyHZdU= github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2 h1:7CP1OWPNk3sLQe5eockBr1l8N5prgO7oDuYO+bNNUrI= github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2/go.mod h1:lad97CcvLKXfU5uWV/9S3QrHUwk6CBDounq7rNs9K0E= -github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 h1:3EaaGPAkwUHVbDKx/TCTAubBUqV8F6++5EaiSiXQgN0= -github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0/go.mod h1:a+PVnn9VNPzPVUiXKXDHK21PSi/TzEKQNIsvSlVXgFY= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3 h1:rGqIKTmugpZ7lEzXTmbiPg45Id09UQpB2YoGaE0J6T4= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3/go.mod h1:A7i1lQClkFz09enKv5WYKb8a2lf9QeeI1s9dNiym3hg= github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 h1:WJt83aWld986AxwJpzE0eDqQi18a/PwZ36y7DqENYdk= github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2/go.mod h1:wIuYBSC8G7HHXK/T6YO0t/m463ssur9aMLnycNvKXqQ= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3/go.mod h1:BiglbKCG56L8tmMnUEyEQo422BO9xnNR8vVHnOsByf8= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2 h1:O6ff5PwwgQ7QkL/XA0H+0U0mWwjkYaP9tHvbr0Ptqak= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.2/go.mod h1:kuVxCbsxbP/h6YTT2BfOj4s/bwXYsG3C/8Qn9gO5QJY= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0 h1:OMzx7qC+hOYJoQYq7RnYkjgCnKTsdIcEM08AUtsXH6A= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.50.0/go.mod h1:VoBcwURHnJVCWuXHdqVuG03i2lUlHJ5DTTqDSyCdEcc= github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0 h1:nZPVFkGojUUJupKJzaCKE07LaFDO3Tto1U69F8JipsI= github.com/aws/aws-sdk-go-v2/service/ec2 v1.136.0/go.mod h1:xYJZQIo/YZxEbeBxUYRQJTCJ924EuKtDfrhVx76yzOE= -github.com/aws/aws-sdk-go-v2/service/ecr v1.17.20 h1:nJnXfQggNZdrWz/0cm2ZGyddGK+FqTiN4QJGanzKZoY= -github.com/aws/aws-sdk-go-v2/service/ecr v1.17.20/go.mod h1:kEVGiy2tACP0cegVqx4MrjsgQMSgrtgRq1fSa+Ix6F0= github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0 h1:GXzeEnCzcbBTCyXunqPApkkya0+lUBFB3IvyH8383pY= github.com/aws/aws-sdk-go-v2/service/ecr v1.23.0/go.mod h1:/ioOZzYo15EL987AAdsmYWKpta8Rokosh5Iax9B6DPg= -github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26 h1:EHJAYkUnlFJ/KwuFMvUs/bPbb0DaqAI+gTfXxffTPZ0= -github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26/go.mod h1:NpR78BP2STxvF/R1GXLDM4gAEfjz68W/h0nC5b6Jk3s= github.com/aws/aws-sdk-go-v2/service/ecs v1.33.1 h1:TozC9N4YIy3daojW5RoutyW0dIBCQvTtMXKDM7cSvW8= github.com/aws/aws-sdk-go-v2/service/ecs v1.33.1/go.mod h1:twzaZjxQJVIuJBlk/PCQ/El6rwvxcCQ2uiO/5BguYHg= -github.com/aws/aws-sdk-go-v2/service/efs v1.19.0 h1:3kuyykZ/ttISUeCeCRa7QBLIknnerNNDYLrAzYAYVjM= -github.com/aws/aws-sdk-go-v2/service/efs v1.19.0/go.mod h1:5MfwGfNzP7d86CrJKNCk7jawZLgBzO4N+X1q/4eYNN8= github.com/aws/aws-sdk-go-v2/service/efs v1.23.2 h1:+Bal9jUaFSjYjiJkoE0eiqCvmknCboCvSCESznszsrQ= github.com/aws/aws-sdk-go-v2/service/efs v1.23.2/go.mod h1:raG1iL/vkJ+4nVtmrc4PgmwH0JgZp5NBOcWFf9GBRJY= -github.com/aws/aws-sdk-go-v2/service/eks v1.21.4 h1:qmKWieiIiYwD46GRD6nxFc1KsyR0ChGRid8emb7rDEY= -github.com/aws/aws-sdk-go-v2/service/eks v1.21.4/go.mod h1:Th2+t6mwi0bZayXUOFOTuyWR2nwRUVcadDy4WGE8C2E= github.com/aws/aws-sdk-go-v2/service/eks v1.33.1 h1:zRB7CTeejJmBpdpzrBkciNLMpg8T+06EvGA/H4Kkvcw= github.com/aws/aws-sdk-go-v2/service/eks v1.33.1/go.mod h1:23btAyMrfTvG2zh/3+CZJ1c2eYWiVWP6tPRJwC67sk8= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.1 h1:QltBKgs6pvGwUDek4LQp51iKY3OVPr/3id24pmbAITM= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.1/go.mod h1:gnN6CtMag9be9XGXsMenh084NcSy5pO0hriEYz/TERk= github.com/aws/aws-sdk-go-v2/service/elasticache v1.32.2 h1:3V4GHH05PtNsDjXlKXVbIw0vSjSNUQoPQEtILns4BMs= github.com/aws/aws-sdk-go-v2/service/elasticache v1.32.2/go.mod h1:p5/Vq+5NiyqnyQyH5JVK3lrHDygbiQiqdCNaDT018I8= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.4 h1:INLSLWNqukSFWYJs8Ejw3jlTLHCUiqQ90tOVXBvhWTY= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.4/go.mod h1:S4aoiQbEwpj9XAgW3Noe8jPArHjW+arHsO6L9t9xbLQ= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.24.2 h1:4pOJ+1slB9s36rDsHvnbUd93SZZ4+Z/FdX5f1TKOiQk= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.24.2/go.mod h1:NatT0jYQo0MfgZnIX8ReNWnbsl4rbQjuS+uci1KNkck= -github.com/aws/aws-sdk-go-v2/service/iam v1.18.9 h1:pVHvEz+KIsTwRKufwvGZr90X/YJ7swVshaBZNY4ESIY= -github.com/aws/aws-sdk-go-v2/service/iam v1.18.9/go.mod h1:ARVuo+lYC2ibYxny/PKC3maaWKLAg25KSq0dkSkE2WE= github.com/aws/aws-sdk-go-v2/service/iam v1.27.2 h1:Z3a5I5kKGsuVW4kbrtHVnLGUHpEpo19zFyo6dzP2WCM= github.com/aws/aws-sdk-go-v2/service/iam v1.27.2/go.mod h1:CYRyr95Q57xVvrcKJu3vw4jVVCZhmY1SyugM+EWXlzI= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3/go.mod h1:gkb2qADY+OHaGLKNTYxMaQNacfeyQpZ4csDTQMeFmcw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10/go.mod h1:9cBNUHI2aW4ho0A5T87O294iPDuuUOSIEDjnd1Lq/z0= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 h1:rpkF4n0CyFcrJUG/rNNohoTmhtWlFTRI4BsZOh9PvLs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1/go.mod h1:l9ymW25HOqymeU2m1gbUQ3rUIsTwKs8gYHXkqDQUhiI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 h1:gVv2vXOMqJeR4ZHHV32K7LElIJIIzyw/RU1b0lSfWTQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9/go.mod h1:EF5RLnD9l0xvEWwMRcktIS/dI6lF8lU5eV3B13k6sWo= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 h1:xbwRyCy7kXrOj89iIKLB6NfE2WCpP9HoKyk8dMDvnIQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3/go.mod h1:R+/S1O4TYpcktbVwddeOYg+uwUfLhADP2S/x4QwsCTM= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 h1:V03dAtcAN4Qtly7H3/0B6m3t/cyl4FgyKFqK738fyJw= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19/go.mod h1:2WpVWFC5n4DYhjNXzObtge8xfgId9UP6GWca46KJFLo= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.3 h1:AakYQhCXteXSRHebRAGDKf/P+3kmEWwiyE3Um/d0ecg= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.3/go.mod h1:wt1Ib9UX0A8fxifnkYLrv7RAlg+ziPR8Fo0NqzuJkHI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8/go.mod h1:rDVhIMAX9N2r8nWxDUlbubvvaFMnfsm+3jAV7q+rpM4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.19/go.mod h1:02CP6iuYP+IVnBX5HULVdSAku/85eHB2Y9EsFhrkEwU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 h1:kJOolE8xBAD13xTCgOakByZkyP4D/owNmvEiioeUNAg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3/go.mod h1:Owv1I59vaghv1Ax8zz8ELY8DN7/Y0rGS+WWAmjgi950= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 h1:TlN1UC39A0LUNoD51ubO5h32haznA+oVe15jO9O4Lj0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8/go.mod h1:JlVwmWtT/1c5W+6oUsjXjAJ0iJZ+hlghdrDy/8JxGCU= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 h1:KV0z2RDc7euMtg8aUT1czv5p29zcLlXALNFsd3jkkEc= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3/go.mod h1:KZgs2ny8HsxRIRbDwgvJcHHBZPOzQr/+NtGwnP+w2ec= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.17.12 h1:Xw1u2pxSAI9giCqYamjNZjFthuh2UjVct8mnv9X2XBo= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.17.12/go.mod h1:DDgzScy4XhYf4xgHP7xVNP3jjwMwMegzusy8awGN7YU= github.com/aws/aws-sdk-go-v2/service/kinesis v1.22.2 h1:kav618UT9BH3kNhEXWo5YPphWBzcxLHp/VKmgXXqM34= github.com/aws/aws-sdk-go-v2/service/kinesis v1.22.2/go.mod h1:pDjJUf6yTIRPsSLDdVI2oR6A9Iv12P1NOL5KaJ9AeRI= -github.com/aws/aws-sdk-go-v2/service/kms v1.18.18 h1:VEj0VdYbmx12y3GKWSXm8hB/mPuSaYHnECRhokHy4Wo= -github.com/aws/aws-sdk-go-v2/service/kms v1.18.18/go.mod h1:kZodDPTQjSH/qM6/OvyTfM5mms5JHB/EKYp5dhn/vI4= github.com/aws/aws-sdk-go-v2/service/kms v1.26.2 h1:cd6qixgKwsu4i1oT14brIYx9qZaXX/9CFrBncxYr7OY= github.com/aws/aws-sdk-go-v2/service/kms v1.26.2/go.mod h1:SBBCPcfsuNkvXnW4sDzoPNeow6xOaU6g2xTfj1dfxo4= -github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4 h1:d1Olp+josNRAlrrtacghtos74rffKS6Mq5gEUBHfgHw= -github.com/aws/aws-sdk-go-v2/service/lambda v1.23.4/go.mod h1:XiSHsT7z5ScD2AsTgfa1UEFQaAr53dHP1oWvaqSW6jQ= github.com/aws/aws-sdk-go-v2/service/lambda v1.48.0 h1:Q1ajPX+B64b/OyxuaSDBjqOMmVrpNLhPfTFghpU783k= github.com/aws/aws-sdk-go-v2/service/lambda v1.48.0/go.mod h1:80TuTBIg7+OWOOA85SdMfvV393HGXPwqoepFTQn6/qA= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4 h1:56esBN+m4kQrGPHZfE60PqfXDryuv8oYbSAc0aU1F10= -github.com/aws/aws-sdk-go-v2/service/opensearch v1.15.4/go.mod h1:2Azx9xDn2nuX+yv4wTR7MO5EYqJNXt2fUC/axUV67qI= github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2 h1:HwLseszN4BX8bbibqfBs+oyAHWb2vFoYQi0P5tPq+74= github.com/aws/aws-sdk-go-v2/service/opensearch v1.25.2/go.mod h1:QHhacFfqWSaj5/N+gPShKlg0V+hsvhnCCtH575tsW3E= -github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= -github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= github.com/aws/aws-sdk-go-v2/service/pricing v1.23.2 h1:EMIsBk8ansD+Fs5Fdl3iFL0Cf9Y++68psfK4Owhbga8= github.com/aws/aws-sdk-go-v2/service/pricing v1.23.2/go.mod h1:UzuiXD0+X63VTTdvwpSwyhBhnwAygld8Ll/gMT6kAOI= -github.com/aws/aws-sdk-go-v2/service/rds v1.30.1 h1:/B3GswjV+ScqZSZnhs3NMLwvVFXb1/aQL/elQwo0CMM= -github.com/aws/aws-sdk-go-v2/service/rds v1.30.1/go.mod h1:wPFe1Cj3nZWmNWKKdkXw961l1dJheTZQ5JjPImqbMuI= github.com/aws/aws-sdk-go-v2/service/rds v1.63.0 h1:Mb6mn6mRfTpI2WEZkLmmJ7jtiPHKzwJ8otzUA5rIq+o= github.com/aws/aws-sdk-go-v2/service/rds v1.63.0/go.mod h1:C73+OVOdaMZNc/Z8PhnLoArk6mCqxkiqfgmCrvNrDDM= -github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5 h1:ufl4QI+6Vuxg6E8UOFVy+CeCtXS+gBMb00oTh2qSPco= -github.com/aws/aws-sdk-go-v2/service/redshift v1.29.5/go.mod h1:U8V+thdAH44/2weiprIA0JyDWa2XBov58TtdjCTTpc8= github.com/aws/aws-sdk-go-v2/service/redshift v1.37.0 h1:h/XTWZNIkMTNZFjnmIRHr+p6BT9esREmacvlXTNfK5w= github.com/aws/aws-sdk-go-v2/service/redshift v1.37.0/go.mod h1:s7X0SVket1YMB6VRzilG1F8k/wQSMgfCL5BYA5d7C04= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 h1:OKQIQ0QhEBmGr2LfT952meIZz3ujrPYnxH+dO/5ldnI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1/go.mod h1:NffjpNsMUFXp6Ok/PahrktAncoekWrywvmIK83Q2raE= github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0 h1:cwTuq73Tv6jtNJIMgTDKsih5O2YsVrKGpg20H98tbmo= github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0/go.mod h1:NXRKkiRF+erX2hnybnVU660cYT5/KChRD4iUgJ97cI8= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2 h1:YQ7/6UE9h6dIHMjHFr4xXLMZDfhwtQUea/D18XAjhcE= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.18.2/go.mod h1:2WSFojT6r+rKQ+3kn3Ss3MGlbR6BwdfsUsk4L/Lrn14= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2 h1:rJPd7ZUwHSJnUUMwZYYQ5diw2En+8Glx9XAwNSyGyTM= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.24.2/go.mod h1:qzLepVh/MNcSxD5o88id3Rt83nBOKDlV6lAMjoSCAHk= -github.com/aws/aws-sdk-go-v2/service/sns v1.18.3 h1:cEFSVrEnbjco0dkcejv7wand04RFaexRdEwbNd1zxCo= -github.com/aws/aws-sdk-go-v2/service/sns v1.18.3/go.mod h1:2cPUjR63iE9MPMPJtSyzYmsTFCNrN/Xi9j0v9BL5OU0= github.com/aws/aws-sdk-go-v2/service/sns v1.25.2 h1:KVWf3qQZxqX0ogLvRfq+uEXfbRexe7Y2JBRQ0TQaxwQ= github.com/aws/aws-sdk-go-v2/service/sns v1.25.2/go.mod h1:gOyDaoXeBT5gwG0DL+5RFQ7cddwLOablLJdXmWSWdyU= -github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12 h1:uiG0JUqcL9w3IUu+tLG/BWJSUUhTgzkMVGThM2wDES4= -github.com/aws/aws-sdk-go-v2/service/sqs v1.19.12/go.mod h1:DKX/7/ZiAzHO6p6AhArnGdrV4r+d461weby8KeVtvC4= github.com/aws/aws-sdk-go-v2/service/sqs v1.28.1 h1:rfX6lA1EW6Q5zT7Cl8RG90hCdWY4VVaobnmbgl5OIy0= github.com/aws/aws-sdk-go-v2/service/sqs v1.28.1/go.mod h1:gGmF6hmPsYUf/kgaSw7BOqLpdVNSfMzGSar61OX812w= -github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2 h1:+5UPNk83hM6HZiHOhZa4hbFIzkVPVsSeaPGWE4lmodk= -github.com/aws/aws-sdk-go-v2/service/ssm v1.36.2/go.mod h1:bE/ToM6K9X5ETp8zaLZf+4JxzXrnk2fNcDoYil4aetg= github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0 h1:hrbnozmShh4n0ar1Zk7Ol0ST1sep1ECGHLwbdbfAFRo= github.com/aws/aws-sdk-go-v2/service/ssm v1.43.0/go.mod h1:5tNnH3XNzW2Jo3TXQjKKH/Ivx7gRsz9nGcvGhq6YPRA= github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 h1:V47N5eKgVZoRSvx2+RQ0EpAEit/pqOhqeSQFiS4OFEQ= github.com/aws/aws-sdk-go-v2/service/sso v1.17.2/go.mod h1:/pE21vno3q1h4bbhUOEi+6Zu/aT26UK2WKkDXd+TssQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.2 h1:sMAcO7VHVw28HTAdZpTULDzFirHOsVm/x25CxhUH0jA= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.2/go.mod h1:dWqm5G767qwKPuayKfzm4rjzFmVjiBFbOJrpSPnAMDs= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 h1:/XiEU7VIFcVWRDQLabyrSjBoKIm8UkYgsvWDuFW8Img= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0/go.mod h1:dWqm5G767qwKPuayKfzm4rjzFmVjiBFbOJrpSPnAMDs= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.2 h1:vwyiRTnXLqsak/6WAQ+uTRhVqKI6vxUQ0HJXjKij0zM= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.2/go.mod h1:4EqRHDCKP78hq3zOnmFXu5k0j4bXbRFfCh/zQ6KnEfQ= github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 h1:M2w4kiMGJCCM6Ljmmx/l6mmpfa3gPJVpBencfnsgvqs= github.com/aws/aws-sdk-go-v2/service/sts v1.25.3/go.mod h1:4EqRHDCKP78hq3zOnmFXu5k0j4bXbRFfCh/zQ6KnEfQ= -github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= @@ -397,7 +291,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/providers/aws/aws.go b/providers/aws/aws.go index c73cebaea..71b82d20a 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -12,6 +12,7 @@ import ( "github.com/tailwarden/komiser/providers/aws/cloudfront" "github.com/tailwarden/komiser/providers/aws/cloudwatch" "github.com/tailwarden/komiser/providers/aws/codebuild" + "github.com/tailwarden/komiser/providers/aws/codedeploy" "github.com/tailwarden/komiser/providers/aws/dynamodb" "github.com/tailwarden/komiser/providers/aws/ec2" "github.com/tailwarden/komiser/providers/aws/ecr" @@ -99,6 +100,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { kinesis.Streams, redshift.EventSubscriptions, codebuild.BuildProjects, + codedeploy.DeploymentGroups, } } diff --git a/providers/aws/codedeploy/deployment_groups.go b/providers/aws/codedeploy/deployment_groups.go new file mode 100644 index 000000000..af214b5e7 --- /dev/null +++ b/providers/aws/codedeploy/deployment_groups.go @@ -0,0 +1,77 @@ +package codedeploy + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/codedeploy" + "github.com/aws/aws-sdk-go-v2/service/sts" + log "github.com/sirupsen/logrus" + "github.com/tailwarden/komiser/models" + "github.com/tailwarden/komiser/providers" + "time" +) + +func DeploymentGroups(ctx context.Context, client providers.ProviderClient) ([]models.Resource, error) { + var listApplicationParams codedeploy.ListApplicationsInput + resources := make([]models.Resource, 0) + codedeployClient := codedeploy.NewFromConfig(*client.AWSClient) + stsClient := sts.NewFromConfig(*client.AWSClient) + stsOutput, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) + if err != nil { + return resources, err + } + accountId := stsOutput.Account + + for { + output, err := codedeployClient.ListApplications(ctx, &listApplicationParams) + if err != nil { + return resources, err + } + for _, application := range output.Applications { + var listDeploymentGroupParams codedeploy.ListDeploymentGroupsInput + listDeploymentGroupParams.ApplicationName = &application + for { + listDeploymentGroupOutput, err := codedeployClient.ListDeploymentGroups(ctx, &listDeploymentGroupParams) + if err != nil { + return resources, nil + } + for _, deploymentGroup := range listDeploymentGroupOutput.DeploymentGroups { + // logic for arn + resourceArn := fmt.Sprintf("arn:aws:codedeploy:%s:%s:deploymentgroup:%s/%s", client.AWSClient.Region, *accountId, application, deploymentGroup) + tags := make([]models.Tag, 0) + resources = append(resources, models.Resource{ + Provider: "AWS", + Account: client.Name, + Service: "CodeDeploy", + ResourceId: resourceArn, + Region: client.AWSClient.Region, + Name: deploymentGroup, + Tags: tags, + FetchedAt: time.Now(), + }) + } + if aws.ToString(listDeploymentGroupOutput.NextToken) == "" { + break + } + listDeploymentGroupParams.NextToken = listDeploymentGroupOutput.NextToken + } + + } + + if aws.ToString(output.NextToken) == "" { + break + } + listApplicationParams.NextToken = output.NextToken + } + + log.WithFields(log.Fields{ + "provider": "AWS", + "account": client.Name, + "region": client.AWSClient.Region, + "service": "CodeDeploy", + "resources": len(resources), + }).Info("Fetched resources") + + return resources, nil +} From 13445cbe5114fbe35fe4e6e8b8cd845c7f9e6372 Mon Sep 17 00:00:00 2001 From: Azanul Haque <42029519+Azanul@users.noreply.github.com> Date: Thu, 30 Nov 2023 18:07:42 +0530 Subject: [PATCH 15/41] Fix accidental loop capture (#1252) * chore: remove dot import Signed-off-by: Azanul * fix: capture of the loop variable Signed-off-by: Azanul * chore: remove duplicate import Signed-off-by: Azanul --------- Signed-off-by: Azanul --- providers/aws/aws.go | 1 + providers/azure/azure.go | 1 + providers/civo/civo.go | 1 + providers/digitalocean/digitalocean.go | 1 + providers/gcp/gcp.go | 1 + providers/k8s/k8s.go | 1 + providers/linode/linode.go | 1 + providers/mongodbatlas/mongodbatlas.go | 1 + providers/oci/oci.go | 1 + providers/ovh/ovh.go | 1 + providers/providers.go | 4 ++-- providers/scaleway/scaleway.go | 1 + providers/tencent/tencent.go | 4 ++-- 13 files changed, 15 insertions(+), 4 deletions(-) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 71b82d20a..585f19c16 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -119,6 +119,7 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region Name: client.Name, } for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/azure/azure.go b/providers/azure/azure.go index ee014ae78..144faa566 100644 --- a/providers/azure/azure.go +++ b/providers/azure/azure.go @@ -32,6 +32,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/civo/civo.go b/providers/civo/civo.go index 80f050f33..663f730d3 100644 --- a/providers/civo/civo.go +++ b/providers/civo/civo.go @@ -30,6 +30,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources regions, err := client.CivoClient.ListRegions() if err != nil { log.Printf("[%s][Civo] %s", client.Name, err) diff --git a/providers/digitalocean/digitalocean.go b/providers/digitalocean/digitalocean.go index 1e9013f56..60fb91308 100644 --- a/providers/digitalocean/digitalocean.go +++ b/providers/digitalocean/digitalocean.go @@ -32,6 +32,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/gcp/gcp.go b/providers/gcp/gcp.go index 4d4c14ba1..794288def 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -41,6 +41,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/k8s/k8s.go b/providers/k8s/k8s.go index d162e4cd1..b8c792d91 100644 --- a/providers/k8s/k8s.go +++ b/providers/k8s/k8s.go @@ -30,6 +30,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/linode/linode.go b/providers/linode/linode.go index 50a1b243d..bed1d7430 100644 --- a/providers/linode/linode.go +++ b/providers/linode/linode.go @@ -34,6 +34,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/mongodbatlas/mongodbatlas.go b/providers/mongodbatlas/mongodbatlas.go index 7f5b846f8..ffca9b32e 100644 --- a/providers/mongodbatlas/mongodbatlas.go +++ b/providers/mongodbatlas/mongodbatlas.go @@ -19,6 +19,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/oci/oci.go b/providers/oci/oci.go index 44dbdd272..601932cfb 100644 --- a/providers/oci/oci.go +++ b/providers/oci/oci.go @@ -29,6 +29,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources wp.SubmitTask(func() { resources, err := fetchResources(ctx, client) if err != nil { diff --git a/providers/ovh/ovh.go b/providers/ovh/ovh.go index 11c264741..ddbd6d1d1 100644 --- a/providers/ovh/ovh.go +++ b/providers/ovh/ovh.go @@ -45,6 +45,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { wp.SubmitTask(func() { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources resources, err := fetchResources(ctx, client) if err != nil { log.Printf("[%s][OVH] %s", client.Name, err) diff --git a/providers/providers.go b/providers/providers.go index 1ad5cda48..c3ad76191 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -12,14 +12,14 @@ import ( "github.com/oracle/oci-go-sdk/common" "github.com/ovh/go-ovh/ovh" "github.com/scaleway/scaleway-sdk-go/scw" - . "github.com/tailwarden/komiser/models" + "github.com/tailwarden/komiser/models" tccvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312" "go.mongodb.org/atlas/mongodbatlas" "golang.org/x/oauth2/google" "k8s.io/client-go/kubernetes" ) -type FetchDataFunction func(ctx context.Context, client ProviderClient) ([]Resource, error) +type FetchDataFunction func(ctx context.Context, client ProviderClient) ([]models.Resource, error) type ProviderClient struct { AWSClient *aws.Config diff --git a/providers/scaleway/scaleway.go b/providers/scaleway/scaleway.go index 7ad09d926..779945f86 100644 --- a/providers/scaleway/scaleway.go +++ b/providers/scaleway/scaleway.go @@ -31,6 +31,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { wp.SubmitTask(func() { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources resources, err := fetchResources(ctx, client) if err != nil { log.Printf("[%s][Scaleway] %s", client.Name, err) diff --git a/providers/tencent/tencent.go b/providers/tencent/tencent.go index 440415d40..38b3327d5 100644 --- a/providers/tencent/tencent.go +++ b/providers/tencent/tencent.go @@ -3,7 +3,6 @@ package tencent import ( "context" - "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "github.com/tailwarden/komiser/providers" @@ -22,6 +21,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { func FetchResources(ctx context.Context, client providers.ProviderClient, db *bun.DB, telemetry bool, analytics utils.Analytics, wp *providers.WorkerPool) { for _, fetchResources := range listOfSupportedServices() { + fetchResources := fetchResources regions, err := client.TencentClient.DescribeRegionsWithContext(ctx, tccvm.NewDescribeRegionsRequest()) if err != nil { log.Errorf("[%s][Tencent] Couldn't fetch the list of regions: %s", client.Name, err) @@ -45,7 +45,7 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, db *bu for _, resource := range resources { _, err := db.NewInsert().Model(&resource).On("CONFLICT (resource_id) DO UPDATE").Set("cost = EXCLUDED.cost").Exec(context.Background()) if err != nil { - logrus.WithError(err).Error("db trigger failed") + log.WithError(err).Error("db trigger failed") } } if telemetry { From ebef48deb541d8964af967b7409fcfa21aa85eab Mon Sep 17 00:00:00 2001 From: Richwin <39644816+AmalRichwin@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:16:40 +0530 Subject: [PATCH 16/41] feat: add aws codecommit resource (#1229) * feat: add aws codecommit resource * chore: remove unused code * chore: remove commented code --------- Co-authored-by: amal richwin --- go.mod | 1 + go.sum | 4 ++ providers/aws/aws.go | 2 + providers/aws/codecommit/repositories.go | 69 ++++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 providers/aws/codecommit/repositories.go diff --git a/go.mod b/go.mod index 953b45b02..2c25dbf41 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,7 @@ require ( require ( cloud.google.com/go/longrunning v0.4.1 // indirect github.com/apache/arrow/go/v11 v11.0.0 // indirect + github.com/aws/aws-sdk-go-v2/service/codecommit v1.18.2 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/google/s2a-go v0.1.4 // indirect diff --git a/go.sum b/go.sum index 1dcfbd603..96e5ba6b4 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,10 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1 h1:TNRPtVMfBVk24DL3o github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.27.1/go.mod h1:f+2AxSfO44KOyp+hsuDsjJyZmaOQxkcmGKRFExyHZdU= github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2 h1:7CP1OWPNk3sLQe5eockBr1l8N5prgO7oDuYO+bNNUrI= github.com/aws/aws-sdk-go-v2/service/codebuild v1.25.2/go.mod h1:lad97CcvLKXfU5uWV/9S3QrHUwk6CBDounq7rNs9K0E= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.18.2 h1:pf48DGYnBziCfCWzL6Cw4fapTNg4qn3NOkKAmds/Ig0= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.18.2/go.mod h1:JzDQFX7S1XLn5z4PnFBEUyTFgxzl7iEOQ1TPpl3OSAs= +github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0 h1:3EaaGPAkwUHVbDKx/TCTAubBUqV8F6++5EaiSiXQgN0= +github.com/aws/aws-sdk-go-v2/service/configservice v1.31.0/go.mod h1:a+PVnn9VNPzPVUiXKXDHK21PSi/TzEKQNIsvSlVXgFY= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3 h1:rGqIKTmugpZ7lEzXTmbiPg45Id09UQpB2YoGaE0J6T4= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.20.3/go.mod h1:A7i1lQClkFz09enKv5WYKb8a2lf9QeeI1s9dNiym3hg= github.com/aws/aws-sdk-go-v2/service/configservice v1.41.2 h1:WJt83aWld986AxwJpzE0eDqQi18a/PwZ36y7DqENYdk= diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 585f19c16..1e03cee43 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -11,6 +11,7 @@ import ( "github.com/tailwarden/komiser/providers/aws/apigateway" "github.com/tailwarden/komiser/providers/aws/cloudfront" "github.com/tailwarden/komiser/providers/aws/cloudwatch" + "github.com/tailwarden/komiser/providers/aws/codecommit" "github.com/tailwarden/komiser/providers/aws/codebuild" "github.com/tailwarden/komiser/providers/aws/codedeploy" "github.com/tailwarden/komiser/providers/aws/dynamodb" @@ -99,6 +100,7 @@ func listOfSupportedServices() []providers.FetchDataFunction { ec2.VpcPeeringConnections, kinesis.Streams, redshift.EventSubscriptions, + codecommit.Repositories, codebuild.BuildProjects, codedeploy.DeploymentGroups, } diff --git a/providers/aws/codecommit/repositories.go b/providers/aws/codecommit/repositories.go new file mode 100644 index 000000000..e33b02e9b --- /dev/null +++ b/providers/aws/codecommit/repositories.go @@ -0,0 +1,69 @@ +package codecommit + +import ( + "context" + "fmt" + "time" + + log "github.com/sirupsen/logrus" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/codecommit" + "github.com/tailwarden/komiser/models" + "github.com/tailwarden/komiser/providers" +) + +func Repositories(ctx context.Context, client providers.ProviderClient) ([]models.Resource, error) { + var listRepoParams codecommit.ListRepositoriesInput + resources := make([]models.Resource, 0) + codecommitClient := codecommit.NewFromConfig(*client.AWSClient) + + for { + output, err := codecommitClient.ListRepositories(ctx, &listRepoParams) + if err != nil { + return resources, err + } + + for _, repository := range output.Repositories { + outputTags, err := codecommitClient.ListTagsForResource(ctx, &codecommit.ListTagsForResourceInput{ + ResourceArn: repository.RepositoryId, + }) + + tags := make([]models.Tag, 0) + if err == nil { + for _, tag := range outputTags.Tags { + tags = append(tags, models.Tag{ + Key: tag, + Value: outputTags.Tags[tag], + }) + } + } + + resources = append(resources, models.Resource{ + Provider: "AWS", + Account: client.Name, + Service: "CodeCommit", + ResourceId: *repository.RepositoryId, + Region: client.AWSClient.Region, + Name: *repository.RepositoryName, + Tags: tags, + FetchedAt: time.Now(), + Link: fmt.Sprintf("https://%s.console.aws.amazon.com/codesuite/codecommit/repositories/%s/browse?region=%s", client.AWSClient.Region, *repository.RepositoryName, client.AWSClient.Region), + }) + } + if aws.ToString(output.NextToken) == "" { + break + } + + listRepoParams.NextToken = output.NextToken + } + + log.WithFields(log.Fields{ + "provider": "AWS", + "account": client.Name, + "region": client.AWSClient.Region, + "service": "CodeCommit", + "resources": len(resources), + }).Info("Fetched resources") + return resources, nil +} From 6e1e34d85024568cb4322e230afc11cb9920820b Mon Sep 17 00:00:00 2001 From: Josh VanderLinden Date: Fri, 1 Dec 2023 05:53:49 -0500 Subject: [PATCH 17/41] Check for nil VpcId and SubnetId before use (#1254) Fixes #1250 Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- providers/aws/ec2/instances.go | 38 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/providers/aws/ec2/instances.go b/providers/aws/ec2/instances.go index 4bc3cbac9..6efb0c11a 100644 --- a/providers/aws/ec2/instances.go +++ b/providers/aws/ec2/instances.go @@ -174,9 +174,9 @@ func Instances(ctx context.Context, client providers.ProviderClient) ([]models.R } func getEC2Relations(inst *etype.Instance, resourceArn string) []models.Link { - + var rel []models.Link - // Get associated security groups + // Get associated security groups for _, sgrp := range inst.SecurityGroups { rel = append(rel, models.Link{ ResourceID: *sgrp.GroupId, @@ -197,21 +197,25 @@ func getEC2Relations(inst *etype.Instance, resourceArn string) []models.Link { }) } - // Get associated VPC - rel = append(rel, models.Link{ - ResourceID: fmt.Sprintf("%s:vpc/%s", resourceArn, *inst.VpcId), - Type: "VPC", - Name: *inst.VpcId, - Relation: "USES", - }) - - // Get associated Subnet - rel = append(rel, models.Link{ - ResourceID: fmt.Sprintf("%s:subnet/%s", resourceArn, *inst.SubnetId), - Name: *inst.SubnetId, - Type: "Subnet", - Relation: "USES", - }) + if inst.VpcId != nil { + // Get associated VPC + rel = append(rel, models.Link{ + ResourceID: fmt.Sprintf("%s:vpc/%s", resourceArn, *inst.VpcId), + Type: "VPC", + Name: *inst.VpcId, + Relation: "USES", + }) + } + + if inst.SubnetId != nil { + // Get associated Subnet + rel = append(rel, models.Link{ + ResourceID: fmt.Sprintf("%s:subnet/%s", resourceArn, *inst.SubnetId), + Name: *inst.SubnetId, + Type: "Subnet", + Relation: "USES", + }) + } // Get associated Keypair if inst.KeyName != nil { From 1109af292e735be6f8885895b1a28a4caf4dbfe6 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Mon, 4 Dec 2023 23:59:16 +0530 Subject: [PATCH 18/41] Migration Nextjs 13 to 14 (#1217) * Migration Nextjs 13 to 14 * fix: next export * add output export property --------- Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- dashboard/next.config.js | 1 + dashboard/package-lock.json | 120 +++++++++++++++++++++--------------- dashboard/package.json | 4 +- 3 files changed, 73 insertions(+), 52 deletions(-) diff --git a/dashboard/next.config.js b/dashboard/next.config.js index 07236bf67..c531a36ed 100644 --- a/dashboard/next.config.js +++ b/dashboard/next.config.js @@ -4,6 +4,7 @@ const withTM = require('next-transpile-modules')(['react-cytoscapejs']); const nextConfig = { reactStrictMode: true, swcMinify: true, + output: 'export', images: { unoptimized: true }, diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 7709f4233..5247f8555 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -19,7 +19,7 @@ "cytoscape-node-html-label": "^1.2.2", "cytoscape-popper": "^2.0.0", "html-to-image": "^1.11.11", - "next": "^13.5.6", + "next": "^14.0.3", "next-transpile-modules": "^10.0.1", "react": "18.2.0", "react-chartjs-2": "^5.2.0", @@ -102,6 +102,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -202,6 +203,7 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -210,6 +212,7 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", + "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", @@ -238,12 +241,14 @@ "node_modules/@babel/core/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -289,6 +294,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", @@ -304,6 +310,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -440,6 +447,7 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", + "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -512,6 +520,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -562,6 +571,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -584,6 +594,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", + "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.15", @@ -3479,9 +3490,9 @@ } }, "node_modules/@next/env": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.6.tgz", - "integrity": "sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw==" + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz", + "integrity": "sha512-7xRqh9nMvP5xrW4/+L0jgRRX+HoNRGnfJpD+5Wq6/13j3dsdzxO3BCXn7D3hMqsDb+vjZnJq+vI7+EtgrYZTeA==" }, "node_modules/@next/eslint-plugin-next": { "version": "13.5.4", @@ -3513,9 +3524,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.6.tgz", - "integrity": "sha512-5nvXMzKtZfvcu4BhtV0KH1oGv4XEW+B+jOfmBdpFI3C7FrB/MfujRpWYSBBO64+qbW8pkZiSyQv9eiwnn5VIQA==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.3.tgz", + "integrity": "sha512-64JbSvi3nbbcEtyitNn2LEDS/hcleAFpHdykpcnrstITFlzFgB/bW0ER5/SJJwUPj+ZPY+z3e+1jAfcczRLVGw==", "cpu": [ "arm64" ], @@ -3528,9 +3539,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.6.tgz", - "integrity": "sha512-6cgBfxg98oOCSr4BckWjLLgiVwlL3vlLj8hXg2b+nDgm4bC/qVXXLfpLB9FHdoDu4057hzywbxKvmYGmi7yUzA==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.3.tgz", + "integrity": "sha512-RkTf+KbAD0SgYdVn1XzqE/+sIxYGB7NLMZRn9I4Z24afrhUpVJx6L8hsRnIwxz3ERE2NFURNliPjJ2QNfnWicQ==", "cpu": [ "x64" ], @@ -3543,9 +3554,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.6.tgz", - "integrity": "sha512-txagBbj1e1w47YQjcKgSU4rRVQ7uF29YpnlHV5xuVUsgCUf2FmyfJ3CPjZUvpIeXCJAoMCFAoGnbtX86BK7+sg==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.3.tgz", + "integrity": "sha512-3tBWGgz7M9RKLO6sPWC6c4pAw4geujSwQ7q7Si4d6bo0l6cLs4tmO+lnSwFp1Tm3lxwfMk0SgkJT7EdwYSJvcg==", "cpu": [ "arm64" ], @@ -3558,9 +3569,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.6.tgz", - "integrity": "sha512-cGd+H8amifT86ZldVJtAKDxUqeFyLWW+v2NlBULnLAdWsiuuN8TuhVBt8ZNpCqcAuoruoSWynvMWixTFcroq+Q==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.3.tgz", + "integrity": "sha512-v0v8Kb8j8T23jvVUWZeA2D8+izWspeyeDGNaT2/mTHWp7+37fiNfL8bmBWiOmeumXkacM/AB0XOUQvEbncSnHA==", "cpu": [ "arm64" ], @@ -3573,9 +3584,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.6.tgz", - "integrity": "sha512-Mc2b4xiIWKXIhBy2NBTwOxGD3nHLmq4keFk+d4/WL5fMsB8XdJRdtUlL87SqVCTSaf1BRuQQf1HvXZcy+rq3Nw==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.3.tgz", + "integrity": "sha512-VM1aE1tJKLBwMGtyBR21yy+STfl0MapMQnNrXkxeyLs0GFv/kZqXS5Jw/TQ3TSUnbv0QPDf/X8sDXuMtSgG6eg==", "cpu": [ "x64" ], @@ -3588,9 +3599,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.6.tgz", - "integrity": "sha512-CFHvP9Qz98NruJiUnCe61O6GveKKHpJLloXbDSWRhqhkJdZD2zU5hG+gtVJR//tyW897izuHpM6Gtf6+sNgJPQ==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.3.tgz", + "integrity": "sha512-64EnmKy18MYFL5CzLaSuUn561hbO1Gk16jM/KHznYP3iCIfF9e3yULtHaMy0D8zbHfxset9LTOv6cuYKJgcOxg==", "cpu": [ "x64" ], @@ -3603,9 +3614,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.6.tgz", - "integrity": "sha512-aFv1ejfkbS7PUa1qVPwzDHjQWQtknzAZWGTKYIAaS4NMtBlk3VyA6AYn593pqNanlicewqyl2jUhQAaFV/qXsg==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.3.tgz", + "integrity": "sha512-WRDp8QrmsL1bbGtsh5GqQ/KWulmrnMBgbnb+59qNTW1kVi1nG/2ndZLkcbs2GX7NpFLlToLRMWSQXmPzQm4tog==", "cpu": [ "arm64" ], @@ -3618,9 +3629,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.6.tgz", - "integrity": "sha512-XqqpHgEIlBHvzwG8sp/JXMFkLAfGLqkbVsyN+/Ih1mR8INb6YCc2x/Mbwi6hsAgUnqQztz8cvEbHJUbSl7RHDg==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.3.tgz", + "integrity": "sha512-EKffQeqCrj+t6qFFhIFTRoqb2QwX1mU7iTOvMyLbYw3QtqTw9sMwjykyiMlZlrfm2a4fA84+/aeW+PMg1MjuTg==", "cpu": [ "ia32" ], @@ -3633,9 +3644,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.6.tgz", - "integrity": "sha512-Cqfe1YmOS7k+5mGu92nl5ULkzpKuxJrP3+4AEuPmrpFZ3BHxTY3TnHmU1On3bFmFFs6FbTcdF58CCUProGpIGQ==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.3.tgz", + "integrity": "sha512-ERhKPSJ1vQrPiwrs15Pjz/rvDHZmkmvbf/BjPN/UCOI++ODftT0GtasDPi0j+y6PPJi5HsXw+dpRaXUaw4vjuQ==", "cpu": [ "x64" ], @@ -9741,7 +9752,7 @@ "version": "3.19.11", "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.19.11.tgz", "integrity": "sha512-ny4i4BOoZxdc9DrSa9RrasXHPRFgt0PeINgj/CegzKu7CJO+UQP0KnjebYJ+KoLymyUbCX86vmqz5B3LK10w5Q==", - "devOptional": true + "dev": true }, "node_modules/@types/cytoscape-popper": { "version": "2.0.3", @@ -11819,6 +11830,7 @@ "version": "4.21.10", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "dev": true, "funding": [ { "type": "opencollective", @@ -13976,7 +13988,8 @@ "node_modules/electron-to-chromium": { "version": "1.4.525", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.525.tgz", - "integrity": "sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==" + "integrity": "sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==", + "dev": true }, "node_modules/elliptic": { "version": "6.5.4", @@ -14309,6 +14322,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "engines": { "node": ">=6" } @@ -15818,6 +15832,7 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -18712,6 +18727,7 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, "bin": { "json5": "lib/cli.js" }, @@ -19022,6 +19038,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, "dependencies": { "yallist": "^3.0.2" } @@ -19487,11 +19504,11 @@ "dev": true }, "node_modules/next": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/next/-/next-13.5.6.tgz", - "integrity": "sha512-Y2wTcTbO4WwEsVb4A8VSnOsG1I9ok+h74q0ZdxkwM3EODqrs4pasq7O0iUxbcS9VtWMicG7f3+HAj0r1+NtKSw==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/next/-/next-14.0.3.tgz", + "integrity": "sha512-AbYdRNfImBr3XGtvnwOxq8ekVCwbFTv/UJoLwmaX89nk9i051AEY4/HAWzU0YpaTDw8IofUpmuIlvzWF13jxIw==", "dependencies": { - "@next/env": "13.5.6", + "@next/env": "14.0.3", "@swc/helpers": "0.5.2", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001406", @@ -19503,18 +19520,18 @@ "next": "dist/bin/next" }, "engines": { - "node": ">=16.14.0" + "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "13.5.6", - "@next/swc-darwin-x64": "13.5.6", - "@next/swc-linux-arm64-gnu": "13.5.6", - "@next/swc-linux-arm64-musl": "13.5.6", - "@next/swc-linux-x64-gnu": "13.5.6", - "@next/swc-linux-x64-musl": "13.5.6", - "@next/swc-win32-arm64-msvc": "13.5.6", - "@next/swc-win32-ia32-msvc": "13.5.6", - "@next/swc-win32-x64-msvc": "13.5.6" + "@next/swc-darwin-arm64": "14.0.3", + "@next/swc-darwin-x64": "14.0.3", + "@next/swc-linux-arm64-gnu": "14.0.3", + "@next/swc-linux-arm64-musl": "14.0.3", + "@next/swc-linux-x64-gnu": "14.0.3", + "@next/swc-linux-x64-musl": "14.0.3", + "@next/swc-win32-arm64-msvc": "14.0.3", + "@next/swc-win32-ia32-msvc": "14.0.3", + "@next/swc-win32-x64-msvc": "14.0.3" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -19663,7 +19680,8 @@ "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true }, "node_modules/normalize-package-data": { "version": "3.0.3", @@ -24111,6 +24129,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, "funding": [ { "type": "opencollective", @@ -24858,7 +24877,8 @@ "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, "node_modules/yaml": { "version": "2.3.2", diff --git a/dashboard/package.json b/dashboard/package.json index 5b458243f..6f96ea004 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev -p 3002", - "build": "next build && next export", + "build": "next build", "start": "next start -p 3002", "lint": "next lint", "format": "prettier --write \"**/*.{ts,tsx,json,css,scss,md}\"", @@ -26,7 +26,7 @@ "cytoscape-node-html-label": "^1.2.2", "cytoscape-popper": "^2.0.0", "html-to-image": "^1.11.11", - "next": "^13.5.6", + "next": "^14.0.3", "next-transpile-modules": "^10.0.1", "react": "18.2.0", "react-chartjs-2": "^5.2.0", From 9ce0b127be7734e6666a3d816cea6fe5afab8a25 Mon Sep 17 00:00:00 2001 From: Azanul Date: Tue, 12 Dec 2023 16:28:12 +0530 Subject: [PATCH 19/41] feat: cache costexplorer output Signed-off-by: Azanul --- providers/aws/aws.go | 49 +++++++--------------- providers/aws/costexplorer.go | 77 +++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 34 deletions(-) create mode 100644 providers/aws/costexplorer.go diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 2af4d122c..42e1ae630 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -2,12 +2,11 @@ package aws import ( "context" + "encoding/json" "strings" "time" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/costexplorer" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" log "github.com/sirupsen/logrus" "github.com/tailwarden/komiser/models" "github.com/tailwarden/komiser/providers" @@ -118,42 +117,24 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region listOfSupportedRegions = regions } - costexplorerClient := costexplorer.NewFromConfig(*client.AWSClient) - costexplorerOutputList := []*costexplorer.GetCostAndUsageOutput{} - var nextPageToken *string - for { - costexplorerOutput, err := costexplorerClient.GetCostAndUsage(ctx, &costexplorer.GetCostAndUsageInput{ - Granularity: "DAILY", - Metrics: []string{"UnblendedCost"}, - TimePeriod: &types.DateInterval{ - Start: aws.String(utils.BeginningOfMonth(time.Now()).Format("2006-01-02")), - End: aws.String(time.Now().Format("2006-01-02")), - }, - GroupBy: []types.GroupDefinition{ - { - Key: aws.String("SERVICE"), - Type: "DIMENSION", - }, - { - Key: aws.String("REGION"), - Type: "DIMENSION", - }, - }, - NextPageToken: nextPageToken, - }) + var costexplorerOutputList []*costexplorer.GetCostAndUsageOutput + if jsonData, err := readCostExplorerCache(); err == nil { + err := json.Unmarshal(jsonData, &costexplorerOutputList) if err != nil { - log.Warn("Couldn't fetch cost and usage data:", err) - break + log.Warn("Failed to unmarshal cached cost explorer data:", err) } - - costexplorerOutputList = append(costexplorerOutputList, costexplorerOutput) - - if aws.ToString(costexplorerOutput.NextPageToken) == "" { - break + } else { + costexplorerOutputList, err = getCostexplorerOutput( + ctx, client, utils.BeginningOfMonth(time.Now()).Format("2006-01-02"), time.Now().Format("2006-01-02"), + ) + if err != nil { + log.Warn("Failed to get cost explorer output:", err) + } + if err := writeCostExplorerCache(costexplorerOutputList); err != nil { + log.Warn("Failed to write cost explorer cache:", err) } - - nextPageToken = costexplorerOutput.NextPageToken } + ctxWithCostexplorerOutput := context.WithValue(ctx, awsUtils.CostexplorerKey, costexplorerOutputList) for _, region := range listOfSupportedRegions { c := client.AWSClient.Copy() diff --git a/providers/aws/costexplorer.go b/providers/aws/costexplorer.go new file mode 100644 index 000000000..eee2f18e9 --- /dev/null +++ b/providers/aws/costexplorer.go @@ -0,0 +1,77 @@ +package aws + +import ( + "context" + "encoding/json" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/costexplorer" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + log "github.com/sirupsen/logrus" + "github.com/tailwarden/komiser/providers" +) + +const costExplorerCacheFile = "cost_explorer_cache.json" + +// readCostExplorerCache reads cost explorer cache data from the file. +func readCostExplorerCache() ([]byte, error) { + file, err := os.ReadFile(costExplorerCacheFile) + if err != nil { + return nil, err + } + return file, nil +} + +// writeCostExplorerCache writes cost explorer cache data to the file. +func writeCostExplorerCache(data interface{}) error { + jsonData, err := json.Marshal(data) + if err != nil { + return err + } + err = os.WriteFile(costExplorerCacheFile, jsonData, 0644) + if err != nil { + return err + } + return nil +} + +func getCostexplorerOutput(ctx context.Context, client providers.ProviderClient, start, end string) ([]*costexplorer.GetCostAndUsageOutput, error) { + costexplorerOutputList := []*costexplorer.GetCostAndUsageOutput{} + costexplorerClient := costexplorer.NewFromConfig(*client.AWSClient) + var nextPageToken *string + for { + costexplorerOutput, err := costexplorerClient.GetCostAndUsage(ctx, &costexplorer.GetCostAndUsageInput{ + Granularity: "DAILY", + Metrics: []string{"UnblendedCost"}, + TimePeriod: &types.DateInterval{ + Start: aws.String(start), + End: aws.String(end), + }, + GroupBy: []types.GroupDefinition{ + { + Key: aws.String("SERVICE"), + Type: "DIMENSION", + }, + { + Key: aws.String("REGION"), + Type: "DIMENSION", + }, + }, + NextPageToken: nextPageToken, + }) + if err != nil { + log.Warn("Couldn't fetch cost and usage data:", err) + return nil, err + } + + costexplorerOutputList = append(costexplorerOutputList, costexplorerOutput) + + if aws.ToString(costexplorerOutput.NextPageToken) == "" { + break + } + + nextPageToken = costexplorerOutput.NextPageToken + } + return costexplorerOutputList, nil +} From 1cd2c375c3e82fb3b3ba534f83bbabf464dc3c2f Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 12:19:16 +0530 Subject: [PATCH 20/41] feat: cache costexplorer output last 6 months Signed-off-by: Azanul --- providers/aws/aws.go | 2 +- utils/datecalc.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 42e1ae630..49647f347 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -125,7 +125,7 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } } else { costexplorerOutputList, err = getCostexplorerOutput( - ctx, client, utils.BeginningOfMonth(time.Now()).Format("2006-01-02"), time.Now().Format("2006-01-02"), + ctx, client, utils.BeginningMonthsAgo(time.Now(), 6).Format("2006-01-02"), utils.BeginningOfMonth(time.Now()).Format("2006-01-02"), ) if err != nil { log.Warn("Failed to get cost explorer output:", err) diff --git a/utils/datecalc.go b/utils/datecalc.go index 242add07a..3df25c0ad 100644 --- a/utils/datecalc.go +++ b/utils/datecalc.go @@ -17,3 +17,11 @@ func EndingOfMonth(date time.Time) time.Time { } return endingOfMonth } + +func BeginningMonthsAgo(date time.Time, months int) time.Time { + beginningOfTargetMonth, err := time.Parse("2006-01-02", date.AddDate(0, -months, -date.Day()+1).Format("2006-01-02")) + if err != nil { + return time.Now() + } + return beginningOfTargetMonth +} From 86d062de533bd9cef92bd305cd30924421d70333 Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 12:27:38 +0530 Subject: [PATCH 21/41] feat: cache costexplorer output last 6 months ending last month Signed-off-by: Azanul --- providers/aws/aws.go | 2 +- utils/datecalc.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 49647f347..4f524d866 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -125,7 +125,7 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } } else { costexplorerOutputList, err = getCostexplorerOutput( - ctx, client, utils.BeginningMonthsAgo(time.Now(), 6).Format("2006-01-02"), utils.BeginningOfMonth(time.Now()).Format("2006-01-02"), + ctx, client, utils.BeginningMonthsAgo(time.Now(), 6).Format("2006-01-02"), utils.EndingOfLastMonth(time.Now()).Format("2006-01-02"), ) if err != nil { log.Warn("Failed to get cost explorer output:", err) diff --git a/utils/datecalc.go b/utils/datecalc.go index 3df25c0ad..2ba7cb2e4 100644 --- a/utils/datecalc.go +++ b/utils/datecalc.go @@ -25,3 +25,11 @@ func BeginningMonthsAgo(date time.Time, months int) time.Time { } return beginningOfTargetMonth } + +func EndingOfLastMonth(date time.Time) time.Time { + endingOfMonth, err := time.Parse("2006-01-02", date.AddDate(0, 0, -date.Day()+1).Format("2006-01-02")) + if err != nil { + return time.Now() + } + return endingOfMonth +} From cfce116ed76d6edd97e5b75b2731b069d48bdd14 Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 16:16:09 +0530 Subject: [PATCH 22/41] fix: disregard region Signed-off-by: Azanul --- providers/aws/utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/aws/utils/utils.go b/providers/aws/utils/utils.go index bcec79e9a..fe5450e76 100644 --- a/providers/aws/utils/utils.go +++ b/providers/aws/utils/utils.go @@ -25,7 +25,7 @@ func GetCostAndUsage(ctx context.Context, region string, svcName string) (float6 for _, costexplorerOutput := range costexplorerOutputList { for _, group := range costexplorerOutput.ResultsByTime { for _, v := range group.Groups { - if v.Keys[0] == svcName && v.Keys[1] == region { + if v.Keys[0] == svcName { amt, err := strconv.ParseFloat(*v.Metrics["UnblendedCost"].Amount, 64) if err != nil { return 0, err From 214ab217af73f35ae3fad5ca3fa8a0662cf5826a Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 16:19:42 +0530 Subject: [PATCH 23/41] fix: use latest costs Signed-off-by: Azanul --- providers/aws/aws.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 4f524d866..a5d740ad2 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -13,8 +13,8 @@ import ( "github.com/tailwarden/komiser/providers/aws/apigateway" "github.com/tailwarden/komiser/providers/aws/cloudfront" "github.com/tailwarden/komiser/providers/aws/cloudwatch" - "github.com/tailwarden/komiser/providers/aws/codecommit" "github.com/tailwarden/komiser/providers/aws/codebuild" + "github.com/tailwarden/komiser/providers/aws/codecommit" "github.com/tailwarden/komiser/providers/aws/codedeploy" "github.com/tailwarden/komiser/providers/aws/dynamodb" "github.com/tailwarden/komiser/providers/aws/ec2" @@ -135,6 +135,10 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } } + costexplorerOutputList, err := getCostexplorerOutput(ctx, client, utils.BeginningOfMonth(time.Now()).Format("2006-01-02"), time.Now().Format("2006-01-02")) + if err != nil { + log.Warn("Failed to get cost explorer output:", err) + } ctxWithCostexplorerOutput := context.WithValue(ctx, awsUtils.CostexplorerKey, costexplorerOutputList) for _, region := range listOfSupportedRegions { c := client.AWSClient.Copy() From 926184f188c92c80e8631ed2706ffdb1aafa3cdd Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 17:06:54 +0530 Subject: [PATCH 24/41] feat: create default config.toml instead of error Signed-off-by: Azanul --- cmd/start.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/start.go b/cmd/start.go index 830d6ed75..230b41bf3 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -2,6 +2,7 @@ package cmd import ( "errors" + "os" "time" "github.com/getsentry/sentry-go" @@ -26,7 +27,12 @@ var startCmd = &cobra.Command{ file, err := cmd.Flags().GetString("config") if err != nil { - return err + log.Info("unable to use given config file:", err) + log.Info("Creating default config.toml") + err = os.WriteFile("config.toml", []byte{}, 0644) + if err != nil { + return err + } } if file == "" { return errors.New("you must specify a config file with '--config PATH'") From 2cc7aa711db5ffec54115e83a2b978229c843d79 Mon Sep 17 00:00:00 2001 From: Azanul Date: Thu, 14 Dec 2023 18:38:47 +0530 Subject: [PATCH 25/41] fix: create default config.toml instead of error Signed-off-by: Azanul --- cmd/start.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index 230b41bf3..1bf03d31e 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -3,6 +3,7 @@ package cmd import ( "errors" "os" + "path/filepath" "time" "github.com/getsentry/sentry-go" @@ -27,17 +28,26 @@ var startCmd = &cobra.Command{ file, err := cmd.Flags().GetString("config") if err != nil { - log.Info("unable to use given config file:", err) - log.Info("Creating default config.toml") - err = os.WriteFile("config.toml", []byte{}, 0644) - if err != nil { - return err - } + return err } if file == "" { return errors.New("you must specify a config file with '--config PATH'") } + if file == "config.toml" { + filename, err := filepath.Abs(file) + if err != nil { + return err + } + if _, err := os.Stat(filename); errors.Is(err, os.ErrNotExist) { + log.Info("unable to use given config file:", err) + log.Info("Creating default config.toml") + err = os.WriteFile("config.toml", []byte{}, 0644) + if err != nil { + return err + } + } + } regions, err := cmd.Flags().GetStringArray("regions") if err != nil { return err From a8d0feeb6ee131f144fdb37e75cfdd90e040979a Mon Sep 17 00:00:00 2001 From: Azanul Date: Fri, 15 Dec 2023 19:05:00 +0530 Subject: [PATCH 26/41] fix: browser saving confidential data Signed-off-by: Azanul --- dashboard/components/onboarding-wizard/LabelledInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard/components/onboarding-wizard/LabelledInput.tsx b/dashboard/components/onboarding-wizard/LabelledInput.tsx index 629028be6..7b5344913 100644 --- a/dashboard/components/onboarding-wizard/LabelledInput.tsx +++ b/dashboard/components/onboarding-wizard/LabelledInput.tsx @@ -58,6 +58,7 @@ function LabelledInput({ }`} onChange={onChange} defaultValue={value} + autoComplete="off" />
From e0868b465fe14dbd04a42f9d5a89ffe0f8ece163 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:44:39 +0000 Subject: [PATCH 27/41] chore(deps-dev): bump @adobe/css-tools from 4.3.1 to 4.3.2 in /dashboard Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- dashboard/package-lock.json | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 0eb939fe7..d11f05ba9 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -81,9 +81,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", - "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.2.tgz", + "integrity": "sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw==", "dev": true }, "node_modules/@alloc/quick-lru": { @@ -102,7 +102,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -203,7 +202,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -212,7 +210,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", - "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", @@ -241,14 +238,12 @@ "node_modules/@babel/core/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -294,7 +289,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", - "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", @@ -310,7 +304,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -447,7 +440,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", - "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -520,7 +512,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", - "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -571,7 +562,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -594,7 +584,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", - "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.15", @@ -9979,7 +9968,7 @@ "version": "3.19.11", "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.19.11.tgz", "integrity": "sha512-ny4i4BOoZxdc9DrSa9RrasXHPRFgt0PeINgj/CegzKu7CJO+UQP0KnjebYJ+KoLymyUbCX86vmqz5B3LK10w5Q==", - "dev": true + "devOptional": true }, "node_modules/@types/cytoscape-popper": { "version": "2.0.3", @@ -12057,7 +12046,6 @@ "version": "4.21.10", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -14215,8 +14203,7 @@ "node_modules/electron-to-chromium": { "version": "1.4.525", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.525.tgz", - "integrity": "sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==", - "dev": true + "integrity": "sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -14549,7 +14536,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -16059,7 +16045,6 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -18954,7 +18939,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, "bin": { "json5": "lib/cli.js" }, @@ -19265,7 +19249,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, "dependencies": { "yallist": "^3.0.2" } @@ -19908,8 +19891,7 @@ "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", - "dev": true + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" }, "node_modules/normalize-package-data": { "version": "3.0.3", @@ -24357,7 +24339,6 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", - "dev": true, "funding": [ { "type": "opencollective", @@ -25105,8 +25086,7 @@ "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yaml": { "version": "2.3.2", From 66a590d812e5f6724a4dbb5f2f6d5d930f037755 Mon Sep 17 00:00:00 2001 From: Avinesh Tripathi <73980067+AvineshTripathi@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:41:59 +0530 Subject: [PATCH 28/41] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 732b460e7..0d3c9b20d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ -* @mlabouardy @ShubhamPalriwala @AvineshTripathi @greghub @Traxmaxx @Kolawole9 @Azanul @jakepage91 +* @mlabouardy @ShubhamPalriwala @AvineshTripathi @greghub @Traxmaxx @Kolawole99 @Azanul @jakepage91 docs @jakepage91 README.md @jakepage91 CONTRIBUTING.md @jakepage91 From 130e0a04f12ae329cc0cfd1492514455104f9840 Mon Sep 17 00:00:00 2001 From: Ali Reza Yahya Date: Fri, 29 Dec 2023 02:40:43 +0100 Subject: [PATCH 29/41] Add metadata to RDS resources --- providers/aws/rds/auto_backups.go | 7 ++++++- providers/aws/rds/cluster_snapshot.go | 4 ++++ providers/aws/rds/clusters.go | 4 ++++ providers/aws/rds/instances.go | 12 +++++++----- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/providers/aws/rds/auto_backups.go b/providers/aws/rds/auto_backups.go index 73c256622..9fe9c5bc8 100644 --- a/providers/aws/rds/auto_backups.go +++ b/providers/aws/rds/auto_backups.go @@ -3,9 +3,10 @@ package rds import ( "context" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" "time" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/rds" log "github.com/sirupsen/logrus" "github.com/tailwarden/komiser/models" @@ -36,6 +37,10 @@ func AutoBackups(ctx context.Context, client providers.ProviderClient) ([]models Name: _backupName, FetchedAt: time.Now(), Link: fmt.Sprintf("https:/%s.console.aws.amazon.com/rds/home?region=%s#dbinstance:id=%s", client.AWSClient.Region, client.AWSClient.Region, *backup.DBInstanceIdentifier), + Metadata: map[string]string{ + "Engine": *backup.Engine, + "EngineVersion": *backup.EngineVersion, + }, }) } diff --git a/providers/aws/rds/cluster_snapshot.go b/providers/aws/rds/cluster_snapshot.go index 57300aa18..0766b4021 100644 --- a/providers/aws/rds/cluster_snapshot.go +++ b/providers/aws/rds/cluster_snapshot.go @@ -57,6 +57,10 @@ func ClusterSnapshots(ctx context.Context, client providers.ProviderClient) ([]m FetchedAt: time.Now(), Tags: tags, Link: fmt.Sprintf("https:/%s.console.aws.amazon.com/rds/home?region=%s#snapshots-list:id=%s", client.AWSClient.Region, client.AWSClient.Region, *clusterSnapshot.DBClusterSnapshotIdentifier), + Metadata: map[string]string{ + "Engine": *clusterSnapshot.Engine, + "EngineVersion": *clusterSnapshot.EngineVersion, + }, }) } diff --git a/providers/aws/rds/clusters.go b/providers/aws/rds/clusters.go index 0877e7f49..ec3d398e4 100644 --- a/providers/aws/rds/clusters.go +++ b/providers/aws/rds/clusters.go @@ -51,6 +51,10 @@ func Clusters(ctx context.Context, client ProviderClient) ([]Resource, error) { FetchedAt: time.Now(), Tags: tags, Link: fmt.Sprintf("https:/%s.console.aws.amazon.com/rds/home?region=%s#database:id=%s", client.AWSClient.Region, client.AWSClient.Region, *cluster.DBClusterIdentifier), + Metadata: map[string]string{ + "Engine": *cluster.Engine, + "EngineVersion": *cluster.EngineVersion, + }, }) } diff --git a/providers/aws/rds/instances.go b/providers/aws/rds/instances.go index 9a30ee538..6515ed4f6 100644 --- a/providers/aws/rds/instances.go +++ b/providers/aws/rds/instances.go @@ -122,12 +122,14 @@ func Instances(ctx context.Context, client providers.ProviderClient) ([]models.R ResourceId: *instance.DBInstanceArn, Cost: monthlyCost, Metadata: map[string]string{ - "serviceCost": fmt.Sprint(serviceCost), + "serviceCost": fmt.Sprint(serviceCost), + "engine": *instance.Engine, + "engineVersion": *instance.EngineVersion, }, - Name: _instanceName, - FetchedAt: time.Now(), - Tags: tags, - Link: fmt.Sprintf("https:/%s.console.aws.amazon.com/rds/home?region=%s#database:id=%s", client.AWSClient.Region, client.AWSClient.Region, *instance.DBInstanceIdentifier), + Name: _instanceName, + FetchedAt: time.Now(), + Tags: tags, + Link: fmt.Sprintf("https:/%s.console.aws.amazon.com/rds/home?region=%s#database:id=%s", client.AWSClient.Region, client.AWSClient.Region, *instance.DBInstanceIdentifier), }) } From b06a409b1ae681b934fc3c3b20c668ee0f661f99 Mon Sep 17 00:00:00 2001 From: Ali Reza Yahya Date: Fri, 29 Dec 2023 04:22:42 +0100 Subject: [PATCH 30/41] feat(dashboard): add metadata display to InventorySidePanel --- .../inventory/components/InventorySidePanel.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dashboard/components/inventory/components/InventorySidePanel.tsx b/dashboard/components/inventory/components/InventorySidePanel.tsx index 4f845aeb1..bf5e1c8bd 100644 --- a/dashboard/components/inventory/components/InventorySidePanel.tsx +++ b/dashboard/components/inventory/components/InventorySidePanel.tsx @@ -157,6 +157,23 @@ function InventorySidePanel({ )}
+ {data && data.metadata !== null && ( +
+

+ Metadata +

+

+ {!data && ( +

+ )} + {data && ( +
+                      {JSON.stringify(data.metadata, null, 2)}
+                    
+ )} +

+
+ )}
)} From 71f88b11d9610775c6b1463ad8fcf2e2e7244d82 Mon Sep 17 00:00:00 2001 From: syedbarimanjan Date: Mon, 1 Jan 2024 22:59:30 +0500 Subject: [PATCH 31/41] feat(ui): add new group-by option --- .../components/cost-explorer/hooks/useCostExplorer.tsx | 7 ++++++- .../cost-explorer/hooks/useCostExplorerChart.tsx | 5 +++-- .../resources-manager/hooks/useResourcesManager.tsx | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx index 7b8eba919..3f9138008 100644 --- a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx +++ b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx @@ -21,7 +21,8 @@ export type CostExplorerQueryGroupProps = | 'service' | 'region' | 'account' - | 'view'; + | 'view' + | 'Resource'; export type CostExplorerQueryGranularityProps = 'monthly' | 'daily'; export type CostExplorerQueryDateProps = | 'thisMonth' @@ -41,6 +42,7 @@ function useCostExplorer() { const [queryDate, setQueryDate] = useState('lastSixMonths'); const [exclude, setExclude] = useState([]); + console.log(exclude) const previousQueryGroup = useRef(queryGroup); function fetch( @@ -84,6 +86,7 @@ function useCostExplorer() { end: endDate, exclude }; + console.log(payload) const payloadJson = JSON.stringify(payload); settingsService.getCostExplorer(payloadJson).then(res => { @@ -98,6 +101,8 @@ function useCostExplorer() { } useEffect(() => { + console.log(queryGroup) + console.log(previousQueryGroup) if (queryGroup !== previousQueryGroup.current) { setExclude([]); } diff --git a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorerChart.tsx b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorerChart.tsx index 5baff1201..d600f23fb 100644 --- a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorerChart.tsx +++ b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorerChart.tsx @@ -84,12 +84,13 @@ function useCostExplorerChart({ }; */ const groupBySelect: GroupBySelectProps = { - values: ['provider', 'service', 'region', 'account'], + values: ['provider', 'service', 'region', 'account','Resource'], displayValues: [ 'Cloud provider', 'Cloud service', 'Cloud region', - 'Cloud account' + 'Cloud account', + 'Resource' ] }; diff --git a/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx b/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx index fb5a1fae5..f1c8ddd1f 100644 --- a/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx +++ b/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx @@ -11,7 +11,8 @@ export type ResourcesManagerQuery = | 'service' | 'region' | 'account' - | 'view'; + | 'view' + | 'Resource'; export type ResourcesManagerGroupBySelectProps = { values: ResourcesManagerQuery[]; @@ -23,6 +24,7 @@ function useResourcesManager() { const [data, setData] = useState(); const [error, setError] = useState(false); const [query, setQuery] = useState('provider'); + console.log(query) const [exclude, setExclude] = useState([]); const previousQuery = useRef(query); From 33c25ed70f9e7363c4be49fb840eadcc1963b214 Mon Sep 17 00:00:00 2001 From: syedbarimanjan Date: Mon, 1 Jan 2024 23:02:58 +0500 Subject: [PATCH 32/41] feat(ui): add group-by-resource state to cost explorer widget --- .../DashboardCostExplorerCard.tsx | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dashboard/components/dashboard/components/cost-explorer/DashboardCostExplorerCard.tsx b/dashboard/components/dashboard/components/cost-explorer/DashboardCostExplorerCard.tsx index 83318b374..4374fd93d 100644 --- a/dashboard/components/dashboard/components/cost-explorer/DashboardCostExplorerCard.tsx +++ b/dashboard/components/dashboard/components/cost-explorer/DashboardCostExplorerCard.tsx @@ -117,7 +117,39 @@ function DashboardCostExplorerCard({
{chartData && } - {!chartData && ( + {/* โคต will be removed when cost is supported at Resource level */} + {queryGroup === 'Resource' && ( +
+
+
+

+ Cost at resource level not yet supported +

+

+ We recommend our cloud version, Tailwarden,
+ as it supports accurate costs at the resource level +

+ + +
+ Purplin on a Rocket +
+
+ )} + {!chartData && queryGroup !== 'Resource' && (
From a8a8c1f1303e65162868b0d5ec6fc66a879a9431 Mon Sep 17 00:00:00 2001 From: syedbarimanjan Date: Mon, 1 Jan 2024 23:18:56 +0500 Subject: [PATCH 33/41] style: remove console logs --- .../components/cost-explorer/hooks/useCostExplorer.tsx | 4 ---- .../resources-manager/hooks/useResourcesManager.tsx | 1 - dashboard/components/select/Select.tsx | 1 - 3 files changed, 6 deletions(-) diff --git a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx index 3f9138008..2a0b9b402 100644 --- a/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx +++ b/dashboard/components/dashboard/components/cost-explorer/hooks/useCostExplorer.tsx @@ -42,7 +42,6 @@ function useCostExplorer() { const [queryDate, setQueryDate] = useState('lastSixMonths'); const [exclude, setExclude] = useState([]); - console.log(exclude) const previousQueryGroup = useRef(queryGroup); function fetch( @@ -86,7 +85,6 @@ function useCostExplorer() { end: endDate, exclude }; - console.log(payload) const payloadJson = JSON.stringify(payload); settingsService.getCostExplorer(payloadJson).then(res => { @@ -101,8 +99,6 @@ function useCostExplorer() { } useEffect(() => { - console.log(queryGroup) - console.log(previousQueryGroup) if (queryGroup !== previousQueryGroup.current) { setExclude([]); } diff --git a/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx b/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx index f1c8ddd1f..8f6a25b5e 100644 --- a/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx +++ b/dashboard/components/dashboard/components/resources-manager/hooks/useResourcesManager.tsx @@ -24,7 +24,6 @@ function useResourcesManager() { const [data, setData] = useState(); const [error, setError] = useState(false); const [query, setQuery] = useState('provider'); - console.log(query) const [exclude, setExclude] = useState([]); const previousQuery = useRef(query); diff --git a/dashboard/components/select/Select.tsx b/dashboard/components/select/Select.tsx index d05ae8d1c..3968727c8 100644 --- a/dashboard/components/select/Select.tsx +++ b/dashboard/components/select/Select.tsx @@ -23,7 +23,6 @@ function Select({ function toggle() { setIsOpen(!isOpen); } - return (
Date: Tue, 2 Jan 2024 23:30:15 +0530 Subject: [PATCH 34/41] @variants directive has been deprecated (#1307) --- dashboard/styles/globals.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/styles/globals.css b/dashboard/styles/globals.css index 1578917f7..78028189f 100644 --- a/dashboard/styles/globals.css +++ b/dashboard/styles/globals.css @@ -32,7 +32,7 @@ } } -@variants responsive { +@layer responsive { /* Chrome, Safari and Opera */ .no-scrollbar::-webkit-scrollbar { display: none; From 6792efeaed3223b56fd01d251ef436979d8f95f7 Mon Sep 17 00:00:00 2001 From: Ali Reza Date: Tue, 2 Jan 2024 19:03:24 +0100 Subject: [PATCH 35/41] Fix typo in triggerFetchingWorkflow function (#1304) Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- internal/internal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/internal.go b/internal/internal.go index 388488bf3..2b8235e24 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -210,7 +210,7 @@ func setupDBConnection(c *models.Config) error { return nil } -func triggerFetchingWorfklow(ctx context.Context, client providers.ProviderClient, provider string, telemetry bool, regions []string, wp *providers.WorkerPool) { +func triggerFetchingWorkflow(ctx context.Context, client providers.ProviderClient, provider string, telemetry bool, regions []string, wp *providers.WorkerPool) { localHub := sentry.CurrentHub().Clone() defer func() { @@ -270,7 +270,7 @@ func fetchResources(ctx context.Context, clients []providers.ProviderClient, reg wwg.Add(1) go func() { defer wwg.Done() - triggerFetchingWorfklow(ctx, client, provider, telemetry, regions, wp) + triggerFetchingWorkflow(ctx, client, provider, telemetry, regions, wp) }() } From 0a3c3ed83747f872086abab982e3d15e05391477 Mon Sep 17 00:00:00 2001 From: Ali Reza Date: Wed, 3 Jan 2024 19:15:29 +0100 Subject: [PATCH 36/41] Update auto_backups.go --- providers/aws/rds/auto_backups.go | 1 - 1 file changed, 1 deletion(-) diff --git a/providers/aws/rds/auto_backups.go b/providers/aws/rds/auto_backups.go index 9fe9c5bc8..777bec933 100644 --- a/providers/aws/rds/auto_backups.go +++ b/providers/aws/rds/auto_backups.go @@ -6,7 +6,6 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/rds" log "github.com/sirupsen/logrus" "github.com/tailwarden/komiser/models" From 2a57179614145966ebeda1e1847633c71fc21746 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Thu, 4 Jan 2024 18:15:28 +0530 Subject: [PATCH 37/41] Setup postgresSQL16 docker image (#1311) --- docker/docker-compose.postgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.postgres.yml b/docker/docker-compose.postgres.yml index d390e39f7..a24ee83df 100644 --- a/docker/docker-compose.postgres.yml +++ b/docker/docker-compose.postgres.yml @@ -11,7 +11,7 @@ services: - 3000:3000 postgres: - image: postgres:13 + image: postgres:16 restart: always environment: - POSTGRES_USER=root From 6c00c48fb5e7b262a584762ab2e6d1ea29cf40eb Mon Sep 17 00:00:00 2001 From: Azanul Date: Fri, 5 Jan 2024 12:14:18 +0530 Subject: [PATCH 38/41] feat: db first then cloud provider Signed-off-by: Azanul --- dashboard/components/layout/Layout.tsx | 2 +- dashboard/pages/onboarding/cloud-accounts/index.tsx | 2 +- dashboard/pages/onboarding/database/postgres.tsx | 2 +- dashboard/pages/onboarding/database/sqlite.tsx | 2 +- handlers/accounts_handler.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dashboard/components/layout/Layout.tsx b/dashboard/components/layout/Layout.tsx index ed4f6ba4f..b18a87246 100644 --- a/dashboard/components/layout/Layout.tsx +++ b/dashboard/components/layout/Layout.tsx @@ -95,7 +95,7 @@ function Layout({ children }: LayoutProps) { title="We could not find a cloud account" message="Get Started Onboarding" action={() => { - router.push('/onboarding/choose-cloud'); + router.push('/onboarding/choose-database'); }} actionLabel="Begin Onboarding" secondaryAction={() => { diff --git a/dashboard/pages/onboarding/cloud-accounts/index.tsx b/dashboard/pages/onboarding/cloud-accounts/index.tsx index 476eb9d20..667bcdd1c 100644 --- a/dashboard/pages/onboarding/cloud-accounts/index.tsx +++ b/dashboard/pages/onboarding/cloud-accounts/index.tsx @@ -99,7 +99,7 @@ export default function CloudAccounts() { ))}
-
diff --git a/dashboard/pages/onboarding/database/postgres.tsx b/dashboard/pages/onboarding/database/postgres.tsx index 7c9850148..ff5a6903a 100644 --- a/dashboard/pages/onboarding/database/postgres.tsx +++ b/dashboard/pages/onboarding/database/postgres.tsx @@ -51,7 +51,7 @@ export default function PostgreSQLCredentials() { message: 'Your Postgres database has been successfully connected to Komiser.' }); - router.push('/onboarding/complete/'); + router.push('/onboarding/choose-cloud/'); } }); }; diff --git a/dashboard/pages/onboarding/database/sqlite.tsx b/dashboard/pages/onboarding/database/sqlite.tsx index de368007e..e21a1afb1 100644 --- a/dashboard/pages/onboarding/database/sqlite.tsx +++ b/dashboard/pages/onboarding/database/sqlite.tsx @@ -50,7 +50,7 @@ export default function SqliteCredentials() { message: 'Your Postgres database has been successfully connected to Komiser.' }); - router.push('/onboarding/complete/'); + router.push('/onboarding/choose-cloud/'); } }); }; diff --git a/handlers/accounts_handler.go b/handlers/accounts_handler.go index 9852c07a6..edf8aec59 100644 --- a/handlers/accounts_handler.go +++ b/handlers/accounts_handler.go @@ -33,7 +33,7 @@ func (handler *ApiHandler) IsOnboardedHandler(c *gin.Context) { } if handler.db == nil { - output.Status = "PENDING_ACCOUNTS" + output.Status = "PENDING_DATABASE" c.JSON(http.StatusOK, output) return } From 72ff8a17e6d7274dde406a4504add46c3bea0e3c Mon Sep 17 00:00:00 2001 From: Azanul Date: Fri, 5 Jan 2024 12:15:27 +0530 Subject: [PATCH 39/41] lint: logrus Signed-off-by: Azanul --- handlers/accounts_handler.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/handlers/accounts_handler.go b/handlers/accounts_handler.go index edf8aec59..57470f6d0 100644 --- a/handlers/accounts_handler.go +++ b/handlers/accounts_handler.go @@ -10,7 +10,6 @@ import ( "github.com/BurntSushi/toml" "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "github.com/tailwarden/komiser/models" "github.com/tailwarden/komiser/utils" @@ -41,7 +40,7 @@ func (handler *ApiHandler) IsOnboardedHandler(c *gin.Context) { accounts := make([]models.Account, 0) err := handler.db.NewRaw("SELECT * FROM accounts").Scan(handler.ctx, &accounts) if err != nil { - logrus.WithError(err).Error("scan failed") + log.WithError(err).Error("scan failed") c.JSON(http.StatusInternalServerError, gin.H{"error": "scan failed"}) return } @@ -65,7 +64,7 @@ func (handler *ApiHandler) ListCloudAccountsHandler(c *gin.Context) { err := handler.db.NewRaw("SELECT * FROM accounts").Scan(handler.ctx, &accounts) if err != nil { - logrus.WithError(err).Error("scan failed") + log.WithError(err).Error("scan failed") c.JSON(http.StatusInternalServerError, gin.H{"error": "scan failed"}) return } From 39db86e00b9eec46ab7a6494c425484385689940 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Fri, 5 Jan 2024 17:05:10 +0530 Subject: [PATCH 40/41] Set timezone and limit for dependabot PR (#1312) * Set timezone and limit for dependabot PR * Remove shubham palriwala --------- Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com> --- .github/dependabot.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 53f93894f..2a406f201 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,9 +4,13 @@ updates: directory: "/dashboard" schedule: interval: "weekly" + time: "23:00" + timezone: Europe/London labels: - - "npm dependencies" + - "dependencies" + open-pull-requests-limit: 10 reviewers: - "mlabouardy" - - "ShubhamPalriwala" + - "Azanul" - "AvineshTripathi" + From 670a5740f1b977352a556d687700a586b9a1285f Mon Sep 17 00:00:00 2001 From: Azanul Date: Mon, 8 Jan 2024 16:46:12 +0530 Subject: [PATCH 41/41] feat: fetch resources on cloud account creation Signed-off-by: Azanul --- handlers/accounts_handler.go | 1 + handlers/helper.go | 345 +++++++++++++++++++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100644 handlers/helper.go diff --git a/handlers/accounts_handler.go b/handlers/accounts_handler.go index 57470f6d0..df5381927 100644 --- a/handlers/accounts_handler.go +++ b/handlers/accounts_handler.go @@ -112,6 +112,7 @@ func (handler *ApiHandler) NewCloudAccountHandler(c *gin.Context) { accountId, _ := result.LastInsertId() account.Id = accountId + go fetchResourcesForAccount(c, account, handler.db, []string{}) } if handler.telemetry { diff --git a/handlers/helper.go b/handlers/helper.go new file mode 100644 index 000000000..615f3e8b4 --- /dev/null +++ b/handlers/helper.go @@ -0,0 +1,345 @@ +package handlers + +import ( + "context" + "fmt" + "net/http" + "os" + "sync" + "time" + + tccommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + tccvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + awsConfig "github.com/aws/aws-sdk-go-v2/config" + "github.com/civo/civogo" + "github.com/digitalocean/godo" + "github.com/linode/linodego" + "github.com/mongodb-forks/digest" + "github.com/oracle/oci-go-sdk/common" + ovhPkg "github.com/ovh/go-ovh/ovh" + "github.com/scaleway/scaleway-sdk-go/scw" + log "github.com/sirupsen/logrus" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions" + "github.com/uptrace/bun" + mdb "go.mongodb.org/atlas/mongodbatlas" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" + + "github.com/getsentry/sentry-go" + "github.com/tailwarden/komiser/models" + "github.com/tailwarden/komiser/providers" + "github.com/tailwarden/komiser/providers/aws" + "github.com/tailwarden/komiser/providers/azure" + "github.com/tailwarden/komiser/providers/civo" + do "github.com/tailwarden/komiser/providers/digitalocean" + "github.com/tailwarden/komiser/providers/gcp" + "github.com/tailwarden/komiser/providers/k8s" + "github.com/tailwarden/komiser/providers/linode" + "github.com/tailwarden/komiser/providers/mongodbatlas" + "github.com/tailwarden/komiser/providers/oci" + "github.com/tailwarden/komiser/providers/ovh" + "github.com/tailwarden/komiser/providers/scaleway" + "github.com/tailwarden/komiser/providers/tencent" + "github.com/tailwarden/komiser/utils" +) + +func triggerFetchingWorkflow(ctx context.Context, client providers.ProviderClient, provider string, db *bun.DB, regions []string, wp *providers.WorkerPool) { + localHub := sentry.CurrentHub().Clone() + + defer func() { + err := recover() + if err != nil { + log.WithField("err", err).Error(fmt.Sprintf("error fetching %s resources", provider)) + localHub.CaptureException(err.(error)) + localHub.Flush(2 * time.Second) + } + }() + + localHub.ConfigureScope(func(scope *sentry.Scope) { + scope.SetTag("provider", provider) + }) + + var analytics utils.Analytics + telemetry := false + switch provider { + case "AWS": + aws.FetchResources(ctx, client, regions, db, telemetry, analytics, wp) + case "DigitalOcean": + do.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "OCI": + oci.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Civo": + civo.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Kubernetes": + k8s.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Linode": + linode.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Tencent": + tencent.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Azure": + azure.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "Scaleway": + scaleway.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "MongoDBAtlas": + mongodbatlas.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "GCP": + gcp.FetchResources(ctx, client, db, telemetry, analytics, wp) + case "OVH": + ovh.FetchResources(ctx, client, db, telemetry, analytics, wp) + } +} + +func fetchResourcesForAccount(ctx context.Context, account models.Account, db *bun.DB, regions []string) { + numWorkers := 64 + wp := providers.NewWorkerPool(numWorkers) + wp.Start() + + var wwg sync.WaitGroup + workflowTrigger := func(client providers.ProviderClient, provider string) { + wwg.Add(1) + go func() { + defer wwg.Done() + triggerFetchingWorkflow(ctx, client, provider, db, regions, wp) + }() + } + + client, err := makeClientFromAccount(account) + if err != nil { + log.Error(err) + return + } + if client.AWSClient != nil { + workflowTrigger(*client, "AWS") + } else if client.DigitalOceanClient != nil { + workflowTrigger(*client, "DigitalOcean") + } else if client.OciClient != nil { + workflowTrigger(*client, "OCI") + } else if client.CivoClient != nil { + workflowTrigger(*client, "Civo") + } else if client.K8sClient != nil { + workflowTrigger(*client, "Kubernetes") + } else if client.LinodeClient != nil { + workflowTrigger(*client, "Linode") + } else if client.TencentClient != nil { + workflowTrigger(*client, "Tencent") + } else if client.AzureClient != nil { + workflowTrigger(*client, "Azure") + } else if client.ScalewayClient != nil { + workflowTrigger(*client, "Scaleway") + } else if client.MongoDBAtlasClient != nil { + workflowTrigger(*client, "MongoDBAtlas") + } else if client.GCPClient != nil { + workflowTrigger(*client, "GCP") + } else if client.OVHClient != nil { + workflowTrigger(*client, "OVH") + } + + wwg.Wait() + wp.Wait() +} + +func makeClientFromAccount(account models.Account) (*providers.ProviderClient, error) { + if account.Provider == "aws" { + if account.Credentials["source"] == "credentials-file" { + if len(account.Credentials["path"]) > 0 { + cfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithSharedConfigProfile(account.Credentials["profile"]), awsConfig.WithSharedCredentialsFiles( + []string{account.Credentials["path"]}, + )) + if err != nil { + return nil, err + } + return &providers.ProviderClient{ + AWSClient: &cfg, + Name: account.Name, + }, nil + } else { + cfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithSharedConfigProfile(account.Credentials["profile"])) + if err != nil { + return nil, err + } + return &providers.ProviderClient{ + AWSClient: &cfg, + Name: account.Name, + }, err + } + } else if account.Credentials["source"] == "environment-variables" { + cfg, err := awsConfig.LoadDefaultConfig(context.Background()) + if err != nil { + return nil, err + } + return &providers.ProviderClient{ + AWSClient: &cfg, + Name: account.Name, + }, nil + } + } + + if account.Provider == "digitalocean" { + client := godo.NewFromToken(account.Credentials["token"]) + return &providers.ProviderClient{ + DigitalOceanClient: client, + Name: account.Name, + }, nil + } + + if account.Provider == "oci" { + if account.Credentials["source"] == "CREDENTIALS_FILE" { + return &providers.ProviderClient{ + OciClient: common.DefaultConfigProvider(), + Name: account.Name, + }, nil + } + } + + if account.Provider == "civo" { + client, err := civogo.NewClient(account.Credentials["token"], "LON1") + if err != nil { + return nil, err + } + return &providers.ProviderClient{ + CivoClient: client, + Name: account.Name, + }, nil + } + + if account.Provider == "kubernetes" { + kubeConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( + &clientcmd.ClientConfigLoadingRules{ExplicitPath: account.Credentials["path"]}, + &clientcmd.ConfigOverrides{}).ClientConfig() + if err != nil { + log.Fatal(err) + } + + k8sClient, err := kubernetes.NewForConfig(kubeConfig) + if err != nil { + log.Fatal(err) + } + + client := providers.K8sClient{ + Client: k8sClient, + OpencostBaseUrl: account.Credentials["opencostbaseurl"], + } + + return &providers.ProviderClient{ + K8sClient: &client, + Name: account.Name, + }, nil + } + + if account.Provider == "linode" { + tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: account.Credentials["token"]}) + oauth2Client := &http.Client{ + Transport: &oauth2.Transport{ + Source: tokenSource, + }, + } + client := linodego.NewClient(oauth2Client) + return &providers.ProviderClient{ + LinodeClient: &client, + Name: account.Name, + }, nil + } + + if account.Provider == "tencent" { + credential := tccommon.NewCredential(account.Credentials["secretId"], account.Credentials["secretKey"]) + cpf := profile.NewClientProfile() + cpf.Language = "en-US" + client, err := tccvm.NewClient(credential, regions.Frankfurt, cpf) + if err != nil { + return nil, err + } + + return &providers.ProviderClient{ + TencentClient: client, + Name: account.Name, + }, nil + } + + if account.Provider == "azure" { + creds, err := azidentity.NewClientSecretCredential(account.Credentials["tenantId"], account.Credentials["clientId"], account.Credentials["clientSecret"], &azidentity.ClientSecretCredentialOptions{}) + if err != nil { + log.Fatal(err) + } + + client := providers.AzureClient{ + Credentials: creds, + SubscriptionId: account.Credentials["subscriptionId"], + } + + return &providers.ProviderClient{ + AzureClient: &client, + Name: account.Name, + }, nil + } + + if account.Provider == "scaleway" { + client, err := scw.NewClient( + scw.WithDefaultOrganizationID(account.Credentials["organizationId"]), + scw.WithAuth(account.Credentials["accessKey"], account.Credentials["secretKey"]), + ) + if err != nil { + return nil, err + } + + return &providers.ProviderClient{ + ScalewayClient: client, + Name: account.Name, + }, nil + } + + if account.Provider == "mongodb" { + t := digest.NewTransport(account.Credentials["publicApiKey"], account.Credentials["privateApiKey"]) + tc, err := t.Client() + if err != nil { + log.Fatal(err.Error()) + } + + client := mdb.NewClient(tc) + return &providers.ProviderClient{ + MongoDBAtlasClient: client, + Name: account.Name, + }, nil + } + + if account.Provider == "gcp" { + data, err := os.ReadFile(account.Credentials["accountKey"]) + if err != nil { + log.Fatal(err) + } + + creds, err := google.CredentialsFromJSON(context.Background(), data, "https://www.googleapis.com/auth/cloud-platform") + if err != nil { + log.Fatal(err) + } + + return &providers.ProviderClient{ + GCPClient: &providers.GCPClient{ + Credentials: creds, + }, + Name: account.Name, + }, nil + } + + if account.Provider == "ovh" { + client, err := ovhPkg.NewClient( + account.Credentials["endpoint"], + account.Credentials["applicationKey"], + account.Credentials["applicationSecret"], + account.Credentials["consumerKey"], + ) + if err != nil { + return nil, err + } + + return &providers.ProviderClient{ + OVHClient: client, + Name: account.Name, + }, nil + } + return nil, fmt.Errorf("provider not supported") +}