Quellcode durchsuchen

Update CloudCost service categorization. GuardDuty should not be
classified as "Compute", but instead as "Other".

Signed-off-by: thomasvn <thomasnguyen96@gmail.com>

thomasvn vor 2 Jahren
Ursprung
Commit
d537f4b517
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4 0
      pkg/cloud/aws/athenaquerier.go

+ 4 - 0
pkg/cloud/aws/athenaquerier.go

@@ -208,6 +208,10 @@ func SelectAWSCategory(providerID, usageType, service string) string {
 	// The node and volume conditions are mutually exclusive.
 	// Provider ID has prefix "i-"
 	if strings.HasPrefix(providerID, "i-") {
+		// GuardDuty has a ProviderID prefix of "i-", but should not be categorized as compute
+		if strings.ToUpper(service) == "AMAZONGUARDDUTY" {
+			return opencost.OtherCategory
+		}
 		return opencost.ComputeCategory
 	}
 	// Provider ID has prefix "vol-"