forked from infracost/infracost
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Elasticsearch and Postgres resources (#198)
* Separate out postgresql resource type * Remove all usage variables * Update Terraform tests for postgresql and elasticsearch * Clear golden file * Remove all usage variables mentions and use * Redefine database resource struct * Improve definition database resource struct * Fix retrieval of values from resource properties * Re-write cost components for elasticsearch * Fix host flavor cost component display * Update defaults for elasticsearch and postgresql * Remove function * Re-write cost components for postgresql * Update Terraform tests for only supported db plans * Update golden file (NOTE ISSUES WITH PRICING DB) * Fix merge conflict * Update databases golden file with latest princing data * Display float when MB not divisible by 1024
- Loading branch information
1 parent
af0e44b
commit 143750a
Showing
8 changed files
with
353 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 31 additions & 41 deletions
72
internal/providers/terraform/ibm/testdata/database_test/database_test.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,34 @@ | ||
|
||
Name Monthly Qty Unit Monthly Cost | ||
|
||
ibm_database.test_db1 | ||
├─ RAM (first 1 GB-RAM) 1 GB-RAM $5.23 | ||
├─ RAM (over 0 GB-RAM) 1 GB-RAM $5.39 | ||
├─ 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_db2 | ||
├─ RAM (first 1 GB-RAM) 1 GB-RAM $5.23 | ||
├─ RAM (over 0 GB-RAM) 1 GB-RAM $5.39 | ||
└─ Disk (first 1 GB-DISK) 1 GB-DISK $0.61 | ||
└─ Disk (over 0 GB-DISK) 1 GB-DISK $0.63 | ||
|
||
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 | ||
|
||
ibm_database.test_es_platinum_db1 | ||
├─ RAM 36 GB-RAM $967.79 | ||
├─ Disk 384 GB-DISK $241.27 | ||
└─ Core 9 Virtual Processor Core $291.08 | ||
|
||
ibm_database.test_es_platinum_db2 | ||
├─ RAM 4 GB-RAM $107.53 | ||
└─ Disk 20 GB-DISK $12.57 | ||
|
||
OVERALL TOTAL $1,837.64 | ||
Name Monthly Qty Unit Monthly Cost | ||
|
||
ibm_database.elasticsearch_enterprise | ||
├─ RAM (3 members) 336 GB $5,433.46 | ||
├─ Disk (3 members) 12,288 GB $7,720.55 | ||
└─ Virtual Processor Cores (3 members) 84 CPU $2,716.73 | ||
|
||
ibm_database.elasticsearch_enterprise_flavor | ||
├─ Host Flavor (3 members, m3c.30x240.encrypted) 3 Flavor $14,553.90 | ||
└─ Disk (3 members) 12,288 GB $7,720.55 | ||
|
||
ibm_database.elasticsearch_platinum | ||
├─ RAM (3 members) 336 GB $9,032.69 | ||
├─ Disk (3 members) 12,288 GB $7,720.55 | ||
└─ Virtual Processor Cores (3 members) 84 CPU $2,716.73 | ||
|
||
ibm_database.elasticsearch_platinum_flavor | ||
├─ Host Flavor (3 members, m3c.30x240.encrypted) 3 Flavor $22,266.54 | ||
└─ Disk (3 members) 12,288 GB $7,720.55 | ||
|
||
ibm_database.postgresql_standard | ||
├─ RAM (2 members) 224 GB $1,206.67 | ||
├─ Disk (2 members) 8,192 GB $5,147.03 | ||
└─ Virtual Processor Cores (2 members) 56 CPU $1,811.15 | ||
|
||
ibm_database.postgresql_standard_flavor | ||
├─ Host Flavor (2 members, m3c.30x240.encrypted) 2 Flavor $4,526.23 | ||
└─ Disk (2 members) 8,192 GB $5,147.03 | ||
|
||
OVERALL TOTAL $105,440.36 | ||
────────────────────────────────── | ||
6 cloud resources were detected: | ||
∙ 6 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file | ||
∙ 6 were estimated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
internal/providers/terraform/ibm/testdata/database_test/database_test.usage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,2 @@ | ||
version: 0.1 | ||
resource_usage: | ||
ibm_database.test_db1: | ||
postgresql_database_ram_mb: 12288 | ||
postgresql_database_disk_mb: 131072 | ||
postgresql_database_core: 3 | ||
ibm_database.test_db2: | ||
postgresql_database_ram_mb: 15360 | ||
postgresql_database_members: 4 | ||
ibm_database.test_es_enterprise_db1: | ||
elasticsearch_database_ram_mb: 12288 | ||
elasticsearch_database_disk_mb: 131072 | ||
elasticsearch_database_core: 3 | ||
ibm_database.test_es_enterprise_db2: | ||
elasticsearch_database_ram_mb: 15360 | ||
elasticsearch_database_members: 4 | ||
ibm_database.test_es_platinum_db1: | ||
elasticsearch_database_ram_mb: 12288 | ||
elasticsearch_database_disk_mb: 131072 | ||
elasticsearch_database_core: 3 | ||
ibm_database.test_es_platinum_db2: | ||
elasticsearch_database_ram_mb: 1024 | ||
elasticsearch_database_members: 4 |
Oops, something went wrong.