diff --git a/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.golden b/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.golden index bce6688f2eb..c36e5239f79 100644 --- a/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.golden +++ b/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.golden @@ -2,7 +2,7 @@ Name Monthly Qty Unit Monthly Cost ibm_cos_bucket.accelerated-archive-us-south - ├─ Accelerated Archive Capacity Monthly cost depends on usage: $0.00418 per GB + ├─ Accelerated Archive Capacity Monthly cost depends on usage: $0.005225 per GB ├─ Accelerated Archive Restore Monthly cost depends on usage: $0.0418 per GB ├─ Storage Capacity (first 499999 GB) Monthly cost depends on usage: $0.02299 per GB ├─ Storage Capacity (over 499999 GB) Monthly cost depends on usage: $0.0209 per GB @@ -13,7 +13,7 @@ └─ Public Standard Egress (over 150000 GB) Monthly cost depends on usage: $0.05 per GB ibm_cos_bucket.archive-us-south - ├─ Archive Capacity 1,000 GB $1.03 + ├─ Archive Capacity 1,000 GB $1.30 ├─ Archive Restore 1,000 GB $20.90 ├─ Storage Capacity (first 499999 GB) Monthly cost depends on usage: $0.02299 per GB ├─ Storage Capacity (over 499999 GB) Monthly cost depends on usage: $0.0209 per GB @@ -93,7 +93,7 @@ └─ Public Standard Egress (next 100000 GB) 0 GB $0.00 └─ Public Standard Egress (over 150000 GB) 0 GB $0.00 - OVERALL TOTAL $495.12 + OVERALL TOTAL $495.39 ────────────────────────────────── 14 cloud resources were detected: ∙ 13 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file diff --git a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden index f8ef2cd0909..d92343b38f2 100644 --- a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden +++ b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden @@ -106,7 +106,7 @@ └─ Lite plan 1 $0.00 ibm_resource_instance.resource_instance_power_iaas - └─ test 1 Instance $0.00 + └─ Workspace for Power Virtual Server 1 Workspace $0.00 ibm_resource_instance.resource_instance_secrets_manager ├─ Instance 1 Instance $321.00 diff --git a/internal/resources/ibm/ibm_cos_bucket.go b/internal/resources/ibm/ibm_cos_bucket.go index 6d5f204ce51..1ff7a812b3e 100644 --- a/internal/resources/ibm/ibm_cos_bucket.go +++ b/internal/resources/ibm/ibm_cos_bucket.go @@ -733,6 +733,14 @@ func (r *IbmCosBucket) LitePlanCostComponent() *schema.CostComponent { Unit: "Instance", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: strPtr(("cloud-object-storage")), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return &costComponent diff --git a/internal/resources/ibm/resource_instance.go b/internal/resources/ibm/resource_instance.go index eda0d1ba7b3..87676fdbb8f 100644 --- a/internal/resources/ibm/resource_instance.go +++ b/internal/resources/ibm/resource_instance.go @@ -315,9 +315,17 @@ func GetSecretsManagerCostComponents(r *ResourceInstance) []*schema.CostComponen } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan: %s", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -327,13 +335,20 @@ func GetSecretsManagerCostComponents(r *ResourceInstance) []*schema.CostComponen } func GetPowerCostComponents(r *ResourceInstance) []*schema.CostComponent { - q := decimalPtr(decimal.NewFromInt(1)) costComponent := schema.CostComponent{ - Name: r.Name, - Unit: "Instance", + Name: "Workspace for Power Virtual Server", + Unit: "Workspace", UnitMultiplier: decimal.NewFromInt(1), - MonthlyQuantity: q, + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -425,9 +440,17 @@ func GetAppIDCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan: %s", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -525,6 +548,14 @@ func GetAppConnectCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -532,9 +563,17 @@ func GetAppConnectCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -553,6 +592,14 @@ func GetLogDNACostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -589,6 +636,14 @@ func GetActivityTrackerCostComponents(r *ResourceInstance) []*schema.CostCompone Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{costComponent} @@ -623,6 +678,14 @@ func GetContinuousDeliveryCostComponenets(r *ResourceInstance) []*schema.CostCom Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{costComponent} diff --git a/internal/resources/ibm/resource_instance_aiopenscale.go b/internal/resources/ibm/resource_instance_aiopenscale.go index be051b05e34..f7f96a9d6c1 100644 --- a/internal/resources/ibm/resource_instance_aiopenscale.go +++ b/internal/resources/ibm/resource_instance_aiopenscale.go @@ -26,14 +26,30 @@ func GetWGOVCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{costComponent} } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_conversation.go b/internal/resources/ibm/resource_instance_conversation.go index 82a680b9be6..af019e32170 100644 --- a/internal/resources/ibm/resource_instance_conversation.go +++ b/internal/resources/ibm/resource_instance_conversation.go @@ -31,6 +31,14 @@ func GetWACostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -41,6 +49,14 @@ func GetWACostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Trial", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -48,9 +64,17 @@ func GetWACostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_discovery.go b/internal/resources/ibm/resource_instance_discovery.go index fbff2f59bb1..62a5faaae31 100644 --- a/internal/resources/ibm/resource_instance_discovery.go +++ b/internal/resources/ibm/resource_instance_discovery.go @@ -33,9 +33,17 @@ func GetWDCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), // Final quantity for this cost component will be divided by this amount MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_dns-svcs.go b/internal/resources/ibm/resource_instance_dns-svcs.go index e4cd703e495..bcc11b6d356 100644 --- a/internal/resources/ibm/resource_instance_dns-svcs.go +++ b/internal/resources/ibm/resource_instance_dns-svcs.go @@ -23,9 +23,17 @@ func GetDNSServicesCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), // Final quantity for this cost component will be divided by this amount MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_messagehub.go b/internal/resources/ibm/resource_instance_messagehub.go index e00becd5e3c..43a714d9737 100644 --- a/internal/resources/ibm/resource_instance_messagehub.go +++ b/internal/resources/ibm/resource_instance_messagehub.go @@ -37,14 +37,30 @@ func GetEventStreamsCostComponents(r *ResourceInstance) []*schema.CostComponent Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{costComponent} } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_pm20.go b/internal/resources/ibm/resource_instance_pm20.go index a25d01a6cd9..0d798757719 100644 --- a/internal/resources/ibm/resource_instance_pm20.go +++ b/internal/resources/ibm/resource_instance_pm20.go @@ -35,6 +35,14 @@ func GetWMLCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -42,9 +50,17 @@ func GetWMLCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_scc.go b/internal/resources/ibm/resource_instance_scc.go index c052b59e33c..75d773025ca 100644 --- a/internal/resources/ibm/resource_instance_scc.go +++ b/internal/resources/ibm/resource_instance_scc.go @@ -20,6 +20,14 @@ func GetSCCCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Trial", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -27,9 +35,17 @@ func GetSCCCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), // Final quantity for this cost component will be divided by this amount MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_studio.go b/internal/resources/ibm/resource_instance_studio.go index 2f07fb2c301..2fe546e8588 100644 --- a/internal/resources/ibm/resource_instance_studio.go +++ b/internal/resources/ibm/resource_instance_studio.go @@ -21,6 +21,14 @@ func GetWSCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -28,9 +36,17 @@ func GetWSCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ diff --git a/internal/resources/ibm/resource_instance_sysdig-monitor.go b/internal/resources/ibm/resource_instance_sysdig-monitor.go index e9ff57b7644..9b341537d8c 100644 --- a/internal/resources/ibm/resource_instance_sysdig-monitor.go +++ b/internal/resources/ibm/resource_instance_sysdig-monitor.go @@ -108,6 +108,14 @@ func GetSysdigCostComponenets(r *ResourceInstance) []*schema.CostComponent { Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{costComponent} diff --git a/internal/resources/ibm/resource_instance_sysdig-secure.go b/internal/resources/ibm/resource_instance_sysdig-secure.go index 9dfed84a7c3..bb49b8114cf 100644 --- a/internal/resources/ibm/resource_instance_sysdig-secure.go +++ b/internal/resources/ibm/resource_instance_sysdig-secure.go @@ -16,6 +16,14 @@ func GetSCCWPCostComponents(r *ResourceInstance) []*schema.CostComponent { Name: "Free Trial", UnitMultiplier: decimal.NewFromInt(1), MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{ @@ -29,9 +37,17 @@ func GetSCCWPCostComponents(r *ResourceInstance) []*schema.CostComponent { } } else { costComponent := schema.CostComponent{ - Name: fmt.Sprintf("Plan %s with customized pricing", r.Plan), + Name: fmt.Sprintf("Plan %s not found", r.Plan), UnitMultiplier: decimal.NewFromInt(1), // Final quantity for this cost component will be divided by this amount MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, } costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) return []*schema.CostComponent{