diff --git a/internal/providers/terraform/ibm/testdata/database_test/database_test.golden b/internal/providers/terraform/ibm/testdata/database_test/database_test.golden index 9586db00386..de6767ae62b 100644 --- a/internal/providers/terraform/ibm/testdata/database_test/database_test.golden +++ b/internal/providers/terraform/ibm/testdata/database_test/database_test.golden @@ -15,7 +15,21 @@ └─ Disk (first 1 GB-DISK) 1 GB-DISK $0.61 └─ Disk (over 0 GB-DISK) 1 GB-DISK $0.63 - OVERALL TOTAL $87.45 + ibm_database.test_es_enterprise_db1 + ├─ RAM (first 1 GB-RAM) 1 GB-RAM $15.70 + ├─ RAM (over 0 GB-RAM) 1 GB-RAM $16.17 + ├─ Disk (first 1 GB-DISK) 1 GB-DISK $0.61 + ├─ Disk (over 0 GB-DISK) 1 GB-DISK $0.63 + └─ Core (first 1 Virtual Processor Core) 1 Virtual Processor Core $31.40 + └─ Core (over 0 Virtual Processor Core) 1 Virtual Processor Core $32.34 + + ibm_database.test_es_enterprise_db2 + ├─ RAM (first 1 GB-RAM) 1 GB-RAM $15.70 + ├─ RAM (over 0 GB-RAM) 1 GB-RAM $16.17 + └─ Disk (first 1 GB-DISK) 1 GB-DISK $0.61 + └─ Disk (over 0 GB-DISK) 1 GB-DISK $0.63 + + OVERALL TOTAL $217.41 ────────────────────────────────── -2 cloud resources were detected: -∙ 2 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file +4 cloud resources were detected: +∙ 4 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/resources/ibm/database.go b/internal/resources/ibm/database.go index c3cfe7c8b70..561eda30de8 100644 --- a/internal/resources/ibm/database.go +++ b/internal/resources/ibm/database.go @@ -23,12 +23,12 @@ type Database struct { // Pricing Link: https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-pricing postgresql_RAM *int64 `infracost_usage:"postgresql_database_ram_mb"` postgresql_Disk *int64 `infracost_usage:"postgresql_database_disk_mb"` - postgresql_Core *int64 `infracost_usage:"postgresql_database_core"` + Core_postgresql *int64 `infracost_usage:"postgresql_database_core"` postgresql_Members *int64 `infracost_usage:"postgresql_database_members"` elasticsearch_RAM *int64 `infracost_usage:"elasticsearch_database_ram_mb"` elasticsearch_Disk *int64 `infracost_usage:"elasticsearch_database_disk_mb"` - elasticsearch_Core *int64 `infracost_usage:"elasticsearch_database_core"` + Core_elasticsearch *int64 `infracost_usage:"elasticsearch_database_core"` elasticsearch_Members *int64 `infracost_usage:"elasticsearch_database_members"` } @@ -138,8 +138,8 @@ func PostgresDiskCostComponent(r *Database) *schema.CostComponent { func PostgresCoreCostComponent(r *Database) *schema.CostComponent { var c decimal.Decimal - if r.postgresql_Core != nil { - c = decimal.NewFromInt(*r.postgresql_Core) + if r.Core_postgresql != nil { + c = decimal.NewFromInt(*r.Core_postgresql) } else { // set the default c = decimal.NewFromInt(0) } @@ -297,8 +297,8 @@ func ElasticSearchDiskCostComponent(r *Database) *schema.CostComponent { func ElasticSearchCoreCostComponent(r *Database) *schema.CostComponent { var c decimal.Decimal - if r.elasticsearch_Core != nil { - c = decimal.NewFromInt(*r.elasticsearch_Core) + if r.Core_elasticsearch != nil { + c = decimal.NewFromInt(*r.Core_elasticsearch) } else { // set the default c = decimal.NewFromInt(0) }