Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ROKs estimates, update golden tests, fix transit gateway estimate #157

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion infracost-usage-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,27 @@ resource_type_default_usage:
kms_key_versions: 10
secretsmanager_active_secrets: 400
secretsmanager_instance: 1
logdna_gigabyte_months: 1
activitytracker_gigabyte_months: 1
monitoring_node_hour: 1
monitoring_container_hour: 1
monitoring_api_call: 1
monitoring_timeseries_hour: 1
continuousdelivery_authorized_users: 1
wml_capacity_unit_hour: 20
wml_instance: 1
wml_class1_ru: 20
wml_class2_ru: 20
wml_class3_ru: 20
ibm_tg_gateway:
connection: 3
data_transfer_global: 1000
data_transfer_local: 1000
ibm_database:
database_ram_mb: 12288
database_disk_mb: 131072
database_core: 3
database_members: 4

resource_usage:
#
Expand Down Expand Up @@ -1274,8 +1291,19 @@ resource_usage:
monitoring_api_call: 100000 # Additional API calls above the base 1M/instance
monitoring_timeseries_hour: 100 # Additional time-series cost above the base 1000/host
continuousdelivery_authorized_users: 10 # Number of authorized users to the CD instance and its managed toolchains

wml_capacity_unit_hour: 20 # Amount of Capacity Unit-Hours used in a month
wml_instance: 1 # The number of instances used per month where each instance includes 2500 CUHs
wml_class1_ru: 20 # The number of resource units used for inferencing with class 1 type models where each ru is 1000 tokens
wml_class2_ru: 20 # The number of resource units used for inferencing with class 2 type models where each ru is 1000 tokens
wml_class3_ru: 20 # The number of resource units used for inferencing with class 3 type models where each ru is 1000 tokens

ibm_tg_gateway.tg_gateway:
connection: 25 # Monthly number of connections to the gateway
data_transfer_local: 2500 # Monthly local traffic through the gateway in GB
data_transfer_global: 2500 # Monthly global traffic through the gateway in GB

ibm_database.postgres:
database_ram_mb: 12288 # Allocated memory in MB per-member
database_disk_mb: 131072 # Allocated disk in MB per-member
database_core: 3 # Allocated dedicated CPU per-member
database_members: 4 # Allocated number of members in the cluster
6 changes: 6 additions & 0 deletions internal/providers/terraform/ibm/ibm.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ var globalCatalogServiceId = map[string]catalogMetadata{
"kms": {"ee41347f-b18e-4ca6-bf80-b5467c63f9a6", []string{}, nil},
"cloud-object-storage": {"dff97f5c-bc5e-4455-b470-411c3edbe49c", []string{}, nil},
"roks": {"containers.kubernetes.cluster.roks", []string{}, nil},
"pm-20": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil},
"data-science-experience": {"39ba9d4c-b1c5-4cc3-a163-38b580121e01", []string{}, nil},
"discovery": {"76b7bf22-b443-47db-b3db-066ba2988f47", []string{}, nil},
"wx": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil},
"conversation": {"7045626d-55e3-4418-be11-683a26dbc1e5", []string{}, nil},
"aiopenscale": {"2ad019f3-0fd6-4c25-966d-f3952481a870", []string{}, nil},
}

func SetCatalogMetadata(d *schema.ResourceData, resourceType string, config map[string]any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
Name Monthly Qty Unit Monthly Cost

Cloudant - dedicated-cloudant - Dedicated-Hardware
└─ Dedicated Hardware 1 instance $5,000.00
└─ Dedicated Hardware 1 instance $5,920.00

Cloudant - lite-cloudant - Lite
└─ Lite Cloudant 1 instance $0.00

Cloudant - standard-cloudant - Standard
├─ Reads (capacity: 1) 100 reads/second $25.00
├─ Writes (capacity: 1) 50 writes/second $25.00
├─ Global Queries (capacity: 1) 5 queries/second $25.00
├─ Reads (capacity: 1) 100 reads/second $29.60
├─ Writes (capacity: 1) 50 writes/second $29.60
├─ Global Queries (capacity: 1) 5 queries/second $29.60
└─ Free Estimated Storage (first 20GB) 20 GB $0.00

Cloudant - standard-cloudant-without-usage - Standard
├─ Reads (capacity: 1) 100 reads/second $25.00
├─ Writes (capacity: 1) 50 writes/second $25.00
├─ Global Queries (capacity: 1) 5 queries/second $25.00
├─ Reads (capacity: 1) 100 reads/second $29.60
├─ Writes (capacity: 1) 50 writes/second $29.60
├─ Global Queries (capacity: 1) 5 queries/second $29.60
├─ Free Estimated Storage (first 20GB) Monthly cost depends on usage: $0.00 per GB
└─ Estimated Storage Monthly cost depends on usage: $1.00 per GB
└─ Estimated Storage Monthly cost depends on usage: $1.18 per GB

Cloudant - standard-exceeded-storage - Standard
├─ Reads (capacity: 1) 100 reads/second $25.00
├─ Writes (capacity: 1) 50 writes/second $25.00
├─ Global Queries (capacity: 1) 5 queries/second $25.00
├─ Reads (capacity: 1) 100 reads/second $29.60
├─ Writes (capacity: 1) 50 writes/second $29.60
├─ Global Queries (capacity: 1) 5 queries/second $29.60
├─ Free Estimated Storage (first 20GB) 20 GB $0.00
└─ Estimated Storage 20 GB $20.00
└─ Estimated Storage 20 GB $23.60

OVERALL TOTAL $5,245.00
OVERALL TOTAL $6,210.00
──────────────────────────────────
5 cloud resources were detected:
∙ 5 were estimated
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.58.0"
version = "1.63.0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@
ibm_is_vpc.vpc1
├─ VPC instance 1 Instance $0.00
├─ VPC egress free allowance (first 5GB) 5 GB $0.00
└─ VPC egress us-south (first 9995 GB) 9,995 GB $869.57
└─ VPC egress us-south (next 40000 GB) 40,000 GB $3,320.00
└─ VPC egress us-south (next 100000 GB) 100 GB $7.00
└─ VPC egress us-south (first 9995 GB) 9,995 GB $908.70
└─ VPC egress us-south (next 40000 GB) 40,000 GB $3,469.40
└─ VPC egress us-south (next 100000 GB) 100 GB $7.32
└─ VPC egress us-south (over 149995 GB) 0 GB $0.00

mycluster
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $565.42
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $565.42
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $608.59
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $608.59

mycluster-without-usage
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 3 hours $0.77
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 3 hours $0.77
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 3 hours $0.83
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 3 hours $0.83

OVERALL TOTAL $5,328.95
mycluster-without-usage
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $983.08
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $983.08

OVERALL TOTAL $7,570.40
──────────────────────────────────
5 cloud resources were detected:
3 were estimated, 1 of which usage-based costs, see https://infracost.io/usage-file
6 cloud resources were detected:
4 were estimated, 1 of which usage-based costs, see https://infracost.io/usage-file
∙ 2 were free:
∙ 2 x ibm_is_subnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.58.0"
version = "1.63.0"
}
}
}
provider "ibm" {
generation = 2
region = "us-south"
ibmcloud_timeout = "1"
max_retries = "1"
}

resource "ibm_is_vpc" "vpc1" {
Expand Down Expand Up @@ -60,3 +62,19 @@ resource "ibm_container_vpc_cluster" "cluster_without_usage" {
name = "us-south-2"
}
}

resource "ibm_container_vpc_cluster" "roks_cluster_with_usage" {
name = "mycluster-without-usage"
vpc_id = ibm_is_vpc.vpc1.id
flavor = "bx2.4x16"
worker_count = 3
kube_version = "4.13_openshift"
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-1"
}
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
Name Monthly Qty Unit Monthly Cost

ibm_container_vpc_worker_pool.cluster_pool
└─ VPC Container Work Zone flavor: (bx2.2x8) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $272.84
└─ VPC Container Work Zone flavor: (bx2.2x8) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $293.67

ibm_container_vpc_worker_pool.cluster_pool_without_usage
└─ VPC Container Work Zone flavor: (bx2.2x8) region: (us-south) name: (us-south-2) x(3) workers 3 hours $0.37
└─ VPC Container Work Zone flavor: (bx2.2x8) region: (us-south) name: (us-south-2) x(3) workers 3 hours $0.40

ibm_is_vpc.vpc1
├─ VPC instance 1 Instance $0.00
├─ VPC egress free allowance (first 5GB) 5 GB $0.00
└─ VPC egress us-south (first 9995 GB) 9,995 GB $869.57
└─ VPC egress us-south (next 40000 GB) 40,000 GB $3,320.00
└─ VPC egress us-south (next 100000 GB) 100 GB $7.00
└─ VPC egress us-south (first 9995 GB) 9,995 GB $908.70
└─ VPC egress us-south (next 40000 GB) 40,000 GB $3,469.40
└─ VPC egress us-south (next 100000 GB) 100 GB $7.32
└─ VPC egress us-south (over 149995 GB) 0 GB $0.00

mycluster
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $565.42
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $608.59

OVERALL TOTAL $5,035.19
OVERALL TOTAL $5,288.07
──────────────────────────────────
6 cloud resources were detected:
∙ 4 were estimated, 3 of which include usage-based costs, see https://infracost.io/usage-file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.58.0"
version = "1.63.0"
}
}
}
Expand Down
Loading
Loading