stocky-salesmen-15167
10/14/2022, 8:02 AM❯ INFRACOST_LOG_LEVEL=debug go test -v -cover ./internal/providers/terraform/aws/fsx_windows_file_system_test.go
=== RUN TestFSXWindowsFS
=== PAUSE TestFSXWindowsFS
=== CONT TestFSXWindowsFS
=== RUN TestFSXWindowsFS/HCL
level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_file_system_ssd SSD storage, using the first product”
testutil.go202 Unexpected log write. To capture logs remove t.Parallel and use GoldenFileOptions { CaptureLogs = true }: level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_file_system_ssd SSD storage, using the first product”
level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_system_ssd SSD storage, using the first product”
testutil.go202 Unexpected log write. To capture logs remove t.Parallel and use GoldenFileOptions { CaptureLogs = true }: level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_system_ssd SSD storage, using the first product”
=== RUN TestFSXWindowsFS/Terraform_CLI
level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_file_system_ssd SSD storage, using the first product”
testutil.go202 Unexpected log write. To capture logs remove t.Parallel and use GoldenFileOptions { CaptureLogs = true }: level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_file_system_ssd SSD storage, using the first product”
level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_system_ssd SSD storage, using the first product”
testutil.go202 Unexpected log write. To capture logs remove t.Parallel and use GoldenFileOptions { CaptureLogs = true }: level=warning msg=“Multiple products with prices found for aws_fsx_windows_file_system.my_system_ssd SSD storage, using the first product”
--- FAIL: TestFSXWindowsFS (6.62s)
--- FAIL: TestFSXWindowsFS/HCL (0.65s)
--- FAIL: TestFSXWindowsFS/Terraform_CLI (5.97s)
FAIL
coverage: [no statements]
FAIL command-line-arguments 7.180s
FAILWhere would I need to start debugging that? Thanks, Johannes
mysterious-teacher-68276
10/14/2022, 8:53 AMSSD
for the AmazonFSx
service.
So the key is to modify the `storageCapacityComponent`:
func (r *FSxWindowsFileSystem) storageCapacityCostComponent() *schema.CostComponent {
deploymentOption := r.deploymentOptionValue()
storageType := r.storageTypeValue()
return &schema.CostComponent{
Name: fmt.Sprintf("%v storage", storageType),
Unit: "GB",
UnitMultiplier: decimal.NewFromInt(1),
MonthlyQuantity: decimalPtr(decimal.NewFromInt(r.StorageCapacityGB)),
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("aws"),
Region: strPtr(r.Region),
Service: strPtr("AmazonFSx"),
ProductFamily: strPtr("Storage"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "deploymentOption", Value: strPtr(deploymentOption)},
{Key: "storageType", Value: strPtr(storageType)},
},
},
}
}
AttributeFilters
to target only a single product entry. The easiest way to find the product your targeting is to boot up the cloud pricing db locally and do some queries. You can find out more about this here: https://github.com/infracost/infracost/blob/master/contributing/add_new_resource_guide.md#price-searchstocky-salesmen-15167
10/14/2022, 9:00 AMmysterious-teacher-68276
10/14/2022, 9:00 AMstocky-salesmen-15167
10/14/2022, 9:45 AMmysterious-teacher-68276
10/14/2022, 9:45 AMstocky-salesmen-15167
10/14/2022, 9:45 AMhacktoberfest-accepted
label on this PR after review 😉mysterious-teacher-68276
10/14/2022, 10:10 AM