Skip to content

Commit

Permalink
Merge branch 'master' into feat/db-for-es-support
Browse files Browse the repository at this point in the history
  • Loading branch information
hiltol authored Jul 29, 2024
2 parents b0ad8e9 + 08fb3b2 commit d331cdb
Show file tree
Hide file tree
Showing 13 changed files with 729 additions and 39 deletions.
47 changes: 47 additions & 0 deletions infracost-usage-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ resource_type_default_usage:
sysdig-secure_VM_NODE_HOUR: 501
aiopenscale_RESOURCE_UNITS: 1
aiopenscale_MODELS_PER_MONTH: 1
dns-svcs_ITEMS: 2 # 1 zone included
dns-svcs_MILLION_ITEMS_CREXTERNALQUERIES: 11 # Tiered; 1-10, 10+
dns-svcs_MILLION_ITEMS: 1001 # Tiered; 1-999, 999+, 1 included
dns-svcs_NUMBERGLB: 1 # Number of GLB HOURS
dns-svcs_NUMBERHEALTHCHECK: 1
dns-svcs_NUMBERPOOLS: 1 # Number of pool HOURS
dns-svcs_RESOLVERLOCATIONS: 1 # Number of resolver location HOURS
dns-svcs_qty_custom_resolver_locations: 1 # Number of resolver locations
dns-svcs_qty_glb_instances: 1 # Number of GLBs
dns-svcs_qty_pools: 1 # Number of pools
messagehub_CAPACITY_UNIT_HOURS: 1
messagehub_qty_capacity_units: 1
messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1
messagehub_qty_capacity_units_additional: 1
messagehub_CAPACITY_UNIT_HOURS_MIRRORING: 1
messagehub_qty_capacity_units_mirroring: 1
messagehub_INSTANCE_HOURS: 1
messagehub_qty_instances: 1
messagehub_TERABYTE_HOURS: 1
messagehub_qty_terabytes: 1
messagehub_GIGABYTE_TRANSMITTED_OUTBOUNDS: 1

ibm_tg_gateway:
connection: 3
data_transfer_global: 1000
Expand Down Expand Up @@ -1355,6 +1377,31 @@ resource_usage:
ibm_resource_instance.watson_governance_standard_v2:
aiopenscale_MODELS_PER_MONTH: 1

ibm_resource_instance.dns_services:
dns-svcs_MILLION_ITEMS_CREXTERNALQUERIES: 11 # Tiered; 1-10, 10+
dns-svcs_MILLION_ITEMS: 1001 # Tiered; 1-999, 999+, 1 included
dns-svcs_NUMBERGLB: 1 # Number of GLB HOURS
dns-svcs_NUMBERHEALTHCHECK: 1
dns-svcs_NUMBERPOOLS: 1 # Number of pool HOURS
dns-svcs_RESOLVERLOCATIONS: 1 # Number of resolver location HOURS
dns-svcs_qty_custom_resolver_locations: 1 # Number of resolver locations
dns-svcs_qty_glb_instances: 1 # Number of GLBs
dns-svcs_qty_pools: 1 # Number of pools

ibm_resource_instance.event_streams:
messagehub_CAPACITY_UNIT_HOURS: 1
messagehub_qty_capacity_units: 1
messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1
messagehub_qty_capacity_units_additional: 1
messagehub_CAPACITY_UNIT_HOURS_MIRRORING: 1
messagehub_qty_capacity_units_mirroring: 1
messagehub_INSTANCE_HOURS: 1
messagehub_qty_instances: 1
messagehub_TERABYTE_HOURS: 1
messagehub_qty_terabytes: 1
messagehub_GIGABYTE_TRANSMITTED_OUTBOUNDS: 1


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
Expand Down
2 changes: 2 additions & 0 deletions internal/providers/terraform/ibm/ibm.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ var globalCatalogServiceId = map[string]catalogMetadata{
"logdnaat": {"dcc46a60-e13b-11e8-a015-757410dab16b", []string{}, nil, "https://cloud.ibm.com/catalog/services/logdnaat"},
"continuous-delivery": {"59b735ee-5938-4ebd-a6b2-541aef2d1f68", []string{}, nil, "https://cloud.ibm.com/catalog/services/continuous-delivery"},
"compliance": {"compliance", []string{}, nil, "https://cloud.ibm.com/catalog/services/security-and-compliance-center"},
"dns-svcs": {"b4ed8a30-936f-11e9-b289-1d079699cbe5", []string{}, nil, "https://cloud.ibm.com/catalog/services/dns-services"},
"messagehub": {"6a7f4e38-f218-48ef-9dd2-df408747568e", []string{}, nil, "https://cloud.ibm.com/eventstreams-provisioning/6a7f4e38-f218-48ef-9dd2-df408747568e/create"},
}

func SetCatalogMetadata(d *schema.ResourceData, resourceType string, config map[string]any) {
Expand Down
2 changes: 2 additions & 0 deletions internal/providers/terraform/ibm/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ var FreeResources = []string{
"ibm_container_addons",
"ibm_cos_bucket_object_lock_configuration",
"ibm_dns_custom_resolver",
"ibm_event_streams_schema",
"ibm_event_streams_topic",
"ibm_iam_access_group",
"ibm_iam_access_group_account_settings",
"ibm_iam_access_group_dynamic_rule",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@

Name Monthly Qty Unit Monthly Cost
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 $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 $682.31
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $682.31
mycluster-without-usage
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 3 hours $0.93
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 3 hours $0.93
myrokscluster-with-usage
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-1) x(3) workers 2,190 hours $1,056.80
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (us-south) name: (us-south-2) x(3) workers 2,190 hours $1,056.80
OVERALL TOTAL $7,865.51
Name Monthly Qty Unit Monthly Cost

ibm_is_vpc.vpc1
├─ VPC instance 1 Instance $0.00
├─ VPC egress free allowance (first 5GB) 5 GB $0.00
└─ VPC egress eu-de (first 9995 GB) 9,995 GB $1,002.70
└─ VPC egress eu-de (next 40000 GB) 40,000 GB $3,803.80
└─ VPC egress eu-de (next 100000 GB) 100 GB $8.05
└─ VPC egress eu-de (over 149995 GB) 0 GB $0.00

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

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

myrokscluster-with-usage
├─ VPC Container Work Zone flavor: (bx2.4x16) region: (eu-de) name: (eu-de-1) x(3) workers 2,190 hours $1,039.78
└─ VPC Container Work Zone flavor: (bx2.4x16) region: (eu-de) name: (eu-de-2) x(3) workers 2,190 hours $1,039.78

OVERALL TOTAL $8,226.30
──────────────────────────────────
6 cloud resources were detected:
∙ 4 were estimated, 1 of which usage-based costs, see https://infracost.io/usage-file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
}
provider "ibm" {
generation = 2
region = "us-south"
region = "eu-de"
ibmcloud_timeout = "1"
max_retries = "1"
}
Expand All @@ -20,14 +20,14 @@ resource "ibm_is_vpc" "vpc1" {
resource "ibm_is_subnet" "subnet1" {
name = "mysubnet1"
vpc = ibm_is_vpc.vpc1.id
zone = "us-south-1"
zone = "eu-de-1"
total_ipv4_address_count = 256
}

resource "ibm_is_subnet" "subnet2" {
name = "mysubnet2"
vpc = ibm_is_vpc.vpc1.id
zone = "us-south-2"
zone = "eu-de-2"
total_ipv4_address_count = 256
}

Expand All @@ -39,11 +39,11 @@ resource "ibm_container_vpc_cluster" "cluster" {
kube_version = "1.17.5"
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-1"
name = "eu-de-1"
}
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-2"
name = "eu-de-2"
}
}

Expand All @@ -55,11 +55,11 @@ resource "ibm_container_vpc_cluster" "cluster_without_usage" {
kube_version = "1.17.5"
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-1"
name = "eu-de-1"
}
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-2"
name = "eu-de-2"
}
}

Expand All @@ -71,10 +71,10 @@ resource "ibm_container_vpc_cluster" "roks_cluster_with_usage" {
kube_version = "4.13_openshift"
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-1"
name = "eu-de-1"
}
zones {
subnet_id = ibm_is_subnet.subnet1.id
name = "us-south-2"
name = "eu-de-2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@
ibm_resource_instance.cd_instance_professional
└─ Authorized Users 2 Authorized Users $75.40

ibm_resource_instance.dns_svcs_standard
├─ Additional Zones 1 Zones $0.54
├─ Pool Hours 1 Hours $0.04
├─ GLB Instance Hours 1 Hours $0.04
├─ Health Checks 1 Health Checks $1.08
├─ Custom Resolver Location Hours 1 Hours $0.13
├─ Million Custom Resolver External Queries (first 10 Million Queries) 10 Million Queries $4.31
├─ Million Custom Resolver External Queries (over 10 Million Queries) 1 Million Queries $0.22
└─ Additional Million DNS Queries (first 999 Million Queries) 999 Million Queries $645.16
└─ Additional Million DNS Queries (over 999 Million Queries) 1 Million Queries $0.32

ibm_resource_instance.messagehub_enterprise
├─ Base Capacity Unit-Hour 1 Hours $7.37
├─ Additional Capacity Unit-Hour 1 Hours $7.37
├─ Additional Storage Terabyte per Hour 10 Hours $6.46
├─ Gigabyte Transmitted Outbound 100 GB $8.61
└─ Mirroring Capacity Unit-Hour 1 Hours $1.47

ibm_resource_instance.messagehub_lite
└─ Lite plan 1 $0.00

ibm_resource_instance.messagehub_satellite
├─ Base Capacity Unit-Hour 1 Hours $7.37
└─ Additional Capacity Unit-Hour 1 Hours $7.37

ibm_resource_instance.messagehub_standard
├─ Partition Hours 100 Hours $1.50
└─ Gigabyte Transmitted Outbound 100 GB $8.61

ibm_resource_instance.resource_instance_activity_tracker_7day
└─ Gigabyte Months 10 Gigabyte Months $16.15

Expand Down Expand Up @@ -168,7 +197,7 @@
├─ Class 2 Resource Units 50 RU $0.09
└─ Class 3 Resource Units 50 RU $0.25

OVERALL TOTAL $18,597.15
OVERALL TOTAL $19,305.11
──────────────────────────────────
36 cloud resources were detected:
36 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file
41 cloud resources were detected:
41 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file
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.63.0"
version = "1.64.0"
}
}
}
Expand Down Expand Up @@ -289,3 +289,43 @@ resource "ibm_resource_instance" "watson_governance_standard_v2" {
location = "us-south"
resource_group_id = "default"
}

resource "ibm_resource_instance" "dns_svcs_standard" {
name = "dns_svcs_standard"
service = "dns-svcs"
plan = "standard-dns"
location = "global"
resource_group_id = "default"
}

resource "ibm_resource_instance" "messagehub_lite" {
name = "messagehub_lite"
service = "messagehub"
plan = "lite"
location = "us-south"
resource_group_id = "default"
}

resource "ibm_resource_instance" "messagehub_standard" {
name = "messagehub_standard"
service = "messagehub"
plan = "standard"
location = "us-south"
resource_group_id = "default"
}

resource "ibm_resource_instance" "messagehub_enterprise" {
name = "messagehub_enterprise"
service = "messagehub"
plan = "enterprise-3nodes-2tb"
location = "us-south"
resource_group_id = "default"
}

resource "ibm_resource_instance" "messagehub_satellite" {
name = "messagehub_satellite"
service = "messagehub"
plan = "satellite"
location = "satcon_dal"
resource_group_id = "default"
}
Loading

0 comments on commit d331cdb

Please sign in to comment.