This message was deleted.
# contributors
b
This message was deleted.
m
Hey @stocky-salesmen-15167, a multiple price warning normally means that the product filter sent to the cloud pricing API is too broad an is not retrieving a single product entry. In the example you’ve given this is most likely because there are multiple products with an attribute
SSD
for the
AmazonFSx
service. So the key is to modify the `storageCapacityComponent`:
Copy code
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-search
let me know if you have any other questions
s
Thanks, that’s already a good guidance. 👍 I’ll let you know when I’m get lost in the 🌲🌲🌲🌲
m
you got it
s
@mysterious-teacher-68276 time for quick help?
m
give me 15 mins
s
👍
Pause - think I got it.
PS: Would ❤️ to get a
hacktoberfest-accepted
label on this PR after review 😉
🚀 1
m
nice work
@stocky-salesmen-15167 of course
🙌 1