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
is_instance
pricing and relevant tests (#199)
* Fix is_instance pricing + tests * Update Terraform tests for local run * Add support for boot volumes + improved testing --------- Co-authored-by: Hilton Lem <[email protected]>
- Loading branch information
1 parent
0d635a9
commit 357217b
Showing
5 changed files
with
316 additions
and
510 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
83 changes: 30 additions & 53 deletions
83
internal/providers/terraform/ibm/testdata/is_instance_test/is_instance_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,57 +1,34 @@ | ||
|
||
Name Monthly Qty Unit Monthly Cost | ||
|
||
ibm_is_instance.testBalancedInstance | ||
├─ CPU hours (32 CPUs, us-east-1) (first 1 CPU hours) 1 CPU hours $0.31 | ||
├─ CPU hours (32 CPUs, us-east-1) (over 0 CPU hours) 1 CPU hours $0.02 | ||
├─ Memory hours (128 GB, us-east-1) (first 1 Memory hours) 1 Memory hours $0.57 | ||
├─ Memory hours (128 GB, us-east-1) (over 0 Memory hours) 1 Memory hours $0.01 | ||
└─ Storage GB hours (600 GB * 2, us-east-1) 876,000 Storage GB hours $23,652.00 | ||
|
||
ibm_is_instance.testBalancedInstanceWithBootVolume | ||
├─ CPU hours (8 CPUs, us-east-1) (first 1 CPU hours) 1 CPU hours $0.31 | ||
├─ CPU hours (8 CPUs, us-east-1) (over 0 CPU hours) 1 CPU hours $0.02 | ||
├─ Memory hours (32 GB, us-east-1) (first 1 Memory hours) 1 Memory hours $0.57 | ||
├─ Memory hours (32 GB, us-east-1) (over 0 Memory hours) 1 Memory hours $0.01 | ||
└─ Boot volume (boot-volume-label, 150 GB) 109,500 GB Hours $12.59 | ||
|
||
ibm_is_instance.testComputeInstance | ||
├─ CPU hours (2 CPUs, us-east-1) (first 1 CPU hours) 1 CPU hours $0.31 | ||
├─ CPU hours (2 CPUs, us-east-1) (over 0 CPU hours) 1 CPU hours $0.02 | ||
└─ Memory hours (4 GB, us-east-1) (first 1 Memory hours) 1 Memory hours $0.84 | ||
└─ Memory hours (4 GB, us-east-1) (over 0 Memory hours) 1 Memory hours $0.01 | ||
|
||
ibm_is_instance.testGpuInstance | ||
├─ CPU hours (16 CPUs, us-east-1) (first 1 CPU hours) 1 CPU hours $0.33 | ||
├─ CPU hours (16 CPUs, us-east-1) (over 0 CPU hours) 1 CPU hours $0.03 | ||
├─ Memory hours (128 GB, us-east-1) (first 1 Memory hours) 1 Memory hours $0.45 | ||
├─ Memory hours (128 GB, us-east-1) (over 0 Memory hours) 1 Memory hours $0.00 | ||
└─ Gpu hours (2 GPUs, Tesla V100, us-east-1) 1,460 Gpu hours $3,051.40 | ||
|
||
ibm_is_instance.testIbmZInstance | ||
├─ CPU hours (16 CPUs, us-east-1) (first 1 CPU hours) 1 CPU hours $0.39 | ||
├─ CPU hours (16 CPUs, us-east-1) (over 0 CPU hours) 1 CPU hours $0.05 | ||
└─ Memory hours (64 GB, us-east-1) (first 1 Memory hours) 1 Memory hours $0.56 | ||
└─ Memory hours (64 GB, us-east-1) (over 0 Memory hours) 1 Memory hours $0.01 | ||
|
||
ibm_is_instance.testInstanceWithoutUsage | ||
├─ CPU hours (2 CPUs, us-east-1) (first 1 CPU hours) Monthly cost depends on usage: $0.31 per CPU hours | ||
├─ CPU hours (2 CPUs, us-east-1) (over 0 CPU hours) Monthly cost depends on usage: $0.0249876337 per CPU hours | ||
└─ Memory hours (4 GB, us-east-1) (first 1 Memory hours) Monthly cost depends on usage: $0.84 per Memory hours | ||
└─ Memory hours (4 GB, us-east-1) (over 0 Memory hours) Monthly cost depends on usage: $0.0075416569 per Memory hours | ||
|
||
ibm_is_vpc.testVpc | ||
├─ VPC instance 1 Instance $0.00 | ||
├─ VPC egress free allowance (first 5GB) Monthly cost depends on usage: $0.00 per GB | ||
└─ VPC egress us-east (first 9995 GB) Monthly cost depends on usage: $0.090915 per GB | ||
└─ VPC egress us-east (next 40000 GB) Monthly cost depends on usage: $0.086735 per GB | ||
└─ VPC egress us-east (next 100000 GB) Monthly cost depends on usage: $0.07315 per GB | ||
└─ VPC egress us-east (over 149995 GB) Monthly cost depends on usage: $0.05225 per GB | ||
|
||
OVERALL TOTAL $26,720.80 | ||
Name Monthly Qty Unit Monthly Cost | ||
|
||
ibm_is_instance.vsi | ||
├─ Instance Hours (cx2-2x4) 730 Hours $64.97 | ||
└─ Boot volume (Unnamed boot volume, 100 GB) 73,000 Hours $8.39 | ||
|
||
ibm_is_instance.vsi_boot_volume | ||
├─ Instance Hours (cx2-2x4) 730 Hours $64.97 | ||
└─ Boot volume (boot-volume-label, 250 GB) 182,500 Hours $20.98 | ||
|
||
ibm_is_instance.vsi_dedicated_host | ||
├─ Instance Hours (cx2-2x4) 730 Hours $64.97 | ||
└─ Boot volume (Unnamed boot volume, 100 GB) 73,000 Hours $8.39 | ||
|
||
ibm_is_vpc.vpc | ||
├─ VPC instance 1 Instance $0.00 | ||
├─ VPC egress free allowance (first 5GB) Monthly cost depends on usage: $0.00 per GB | ||
└─ VPC egress us-south (first 9995 GB) Monthly cost depends on usage: $0.090915 per GB | ||
└─ VPC egress us-south (next 40000 GB) Monthly cost depends on usage: $0.086735 per GB | ||
└─ VPC egress us-south (next 100000 GB) Monthly cost depends on usage: $0.07315 per GB | ||
└─ VPC egress us-south (over 149995 GB) Monthly cost depends on usage: $0.05225 per GB | ||
|
||
OVERALL TOTAL $232.67 | ||
────────────────────────────────── | ||
9 cloud resources were detected: | ||
∙ 7 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file | ||
∙ 2 were free: | ||
∙ 4 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file | ||
∙ 3 were free: | ||
∙ 1 x ibm_is_ssh_key | ||
∙ 1 x ibm_is_subnet | ||
∙ 1 x ibm_is_subnet | ||
∙ 1 x ibm_resource_group | ||
∙ 2 are not supported yet, see https://infracost.io/requested-resources: | ||
∙ 1 x ibm_is_dedicated_host | ||
∙ 1 x ibm_is_dedicated_host_group |
Oops, something went wrong.