Documentation
¶
Overview ¶
Package resources maps Terraform resource types to per-product Mappers.
Adding support for a new resource type = writing one file that implements Mapper.Extract (plan -> PriceRequest) and Mapper.Parse (raw API response -> CostComponents).
Index ¶
- type AWSDBInstance
- type AWSDocDBInstance
- type AWSDynamoDBTable
- type AWSEBSVolume
- type AWSEKSCluster
- type AWSELB
- type AWSElastiCacheCluster
- type AWSInstance
- type AWSLB
- type AWSMQBroker
- type AWSMSKCluster
- type AWSMemoryDBCluster
- type AWSNATGateway
- type AWSNeptuneInstance
- type AWSOpenSearchDomain
- type AWSRDSClusterInstance
- type AWSRedshiftCluster
- type AlibabaDisk
- type AlibabaECS
- type AlibabaEIP
- type AlibabaMongoDB
- type AlibabaNAT
- type AlibabaRDS
- type AlibabaRedis
- type AlibabaSLB
- type AlibabaVPN
- type CBSStorage
- type CDNDomain
- type CFSFileSystem
- type CLBInstance
- type COSBucket
- type CVMInstance
- type CloudHSMInstance
- type CynosDBCluster
- type DCDBInstance
- type DomainRegistration
- type ECMInstance
- type EIP
- type GAAPProxy
- type HuaweiCCE
- type HuaweiDCS
- type HuaweiDDS
- type HuaweiECS
- type HuaweiEIP
- type HuaweiELB
- type HuaweiEVS
- type HuaweiNAT
- type HuaweiRDS
- type LighthouseInstance
- type Mapper
- type MariaDBInstance
- type MongoDBInstance
- type MySQLInstance
- type PostgreSQLInstance
- type RedisInstance
- type Registry
- type SCFFunction
- type SQLServerInstance
- type StaticMapper
- type VPNGateway
- type YunjingLicense
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSDBInstance ¶
type AWSDBInstance struct{}
AWSDBInstance handles `aws_db_instance`.
func (AWSDBInstance) Extract ¶
func (AWSDBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSDBInstance) Parse ¶
func (AWSDBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSDocDBInstance ¶
type AWSDocDBInstance struct{}
AWSDocDBInstance handles `aws_docdb_cluster_instance`.
func (AWSDocDBInstance) Extract ¶
func (AWSDocDBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSDocDBInstance) Parse ¶
func (AWSDocDBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSDynamoDBTable ¶
type AWSDynamoDBTable struct{}
AWSDynamoDBTable handles `aws_dynamodb_table` (provisioned mode only).
func (AWSDynamoDBTable) Extract ¶
func (AWSDynamoDBTable) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSDynamoDBTable) Parse ¶
func (AWSDynamoDBTable) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSEBSVolume ¶
type AWSEBSVolume struct{}
AWSEBSVolume handles `aws_ebs_volume`.
func (AWSEBSVolume) Extract ¶
func (AWSEBSVolume) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSEBSVolume) Parse ¶
func (AWSEBSVolume) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSEKSCluster ¶
type AWSEKSCluster struct{}
AWSEKSCluster handles `aws_eks_cluster` (control plane only).
func (AWSEKSCluster) Extract ¶
func (AWSEKSCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSEKSCluster) Parse ¶
func (AWSEKSCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSELB ¶
type AWSELB struct{}
AWSELB handles `aws_elb` (Classic Load Balancer).
func (AWSELB) Extract ¶
func (AWSELB) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSELB) Parse ¶
func (AWSELB) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSElastiCacheCluster ¶
type AWSElastiCacheCluster struct{}
AWSElastiCacheCluster handles `aws_elasticache_cluster`.
func (AWSElastiCacheCluster) Extract ¶
func (AWSElastiCacheCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSElastiCacheCluster) Parse ¶
func (AWSElastiCacheCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSInstance ¶
type AWSInstance struct{}
AWSInstance handles `aws_instance`.
func (AWSInstance) Extract ¶
func (AWSInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSInstance) Parse ¶
func (AWSInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSLB ¶
type AWSLB struct{}
AWSLB handles `aws_lb` (Application / Network / Gateway load balancers).
func (AWSLB) Extract ¶
func (AWSLB) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSLB) Parse ¶
func (AWSLB) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSMQBroker ¶
type AWSMQBroker struct{}
AWSMQBroker handles `aws_mq_broker`.
func (AWSMQBroker) Extract ¶
func (AWSMQBroker) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSMQBroker) Parse ¶
func (AWSMQBroker) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSMSKCluster ¶
type AWSMSKCluster struct{}
AWSMSKCluster handles `aws_msk_cluster` (provisioned).
func (AWSMSKCluster) Extract ¶
func (AWSMSKCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSMSKCluster) Parse ¶
func (AWSMSKCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSMemoryDBCluster ¶
type AWSMemoryDBCluster struct{}
AWSMemoryDBCluster handles `aws_memorydb_cluster`. Total nodes = num_shards * (1 + num_replicas_per_shard).
func (AWSMemoryDBCluster) Extract ¶
func (AWSMemoryDBCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSMemoryDBCluster) Parse ¶
func (AWSMemoryDBCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSNATGateway ¶
type AWSNATGateway struct{}
AWSNATGateway handles `aws_nat_gateway`.
func (AWSNATGateway) Extract ¶
func (AWSNATGateway) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSNATGateway) Parse ¶
func (AWSNATGateway) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSNeptuneInstance ¶
type AWSNeptuneInstance struct{}
AWSNeptuneInstance handles `aws_neptune_cluster_instance`.
func (AWSNeptuneInstance) Extract ¶
func (AWSNeptuneInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSNeptuneInstance) Parse ¶
func (AWSNeptuneInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSOpenSearchDomain ¶
type AWSOpenSearchDomain struct{}
AWSOpenSearchDomain handles `aws_opensearch_domain` and `aws_elasticsearch_domain` (identical schema for our purposes).
func (AWSOpenSearchDomain) Extract ¶
func (AWSOpenSearchDomain) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSOpenSearchDomain) Parse ¶
func (AWSOpenSearchDomain) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSRDSClusterInstance ¶
type AWSRDSClusterInstance struct{}
AWSRDSClusterInstance handles `aws_rds_cluster_instance` (Aurora members).
func (AWSRDSClusterInstance) Extract ¶
func (AWSRDSClusterInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSRDSClusterInstance) Parse ¶
func (AWSRDSClusterInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AWSRedshiftCluster ¶
type AWSRedshiftCluster struct{}
AWSRedshiftCluster handles `aws_redshift_cluster`.
func (AWSRedshiftCluster) Extract ¶
func (AWSRedshiftCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AWSRedshiftCluster) Parse ¶
func (AWSRedshiftCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaDisk ¶ added in v0.3.0
type AlibabaDisk struct{}
AlibabaDisk handles `alicloud_disk` (cloud disk / EBS equivalent).
func (AlibabaDisk) Extract ¶ added in v0.3.0
func (AlibabaDisk) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaDisk) Parse ¶ added in v0.3.0
func (AlibabaDisk) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaECS ¶ added in v0.3.0
type AlibabaECS struct{}
AlibabaECS handles `alicloud_instance` (ECS).
Priced via Alibaba Cloud BSS GetPayAsYouGoPrice with ProductCode "ecs". ModuleList: InstanceType, SystemDisk (optional).
func (AlibabaECS) Extract ¶ added in v0.3.0
func (AlibabaECS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaECS) Parse ¶ added in v0.3.0
func (AlibabaECS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaEIP ¶ added in v0.3.0
type AlibabaEIP struct{}
AlibabaEIP handles `alicloud_eip` (elastic IP).
Priced via Alibaba Cloud BSS GetPayAsYouGoPrice with ProductCode "eip". ModuleList: Bandwidth (Kbps, per-DAY), InternetChargeType (0 = by-bandwidth, 1 = by-traffic), ISP (BGP). EIP bandwidth is quoted per day, so the monthly figure uses daysPerMonth (30), not hoursPerMonth.
func (AlibabaEIP) Extract ¶ added in v0.3.0
func (AlibabaEIP) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaEIP) Parse ¶ added in v0.3.0
func (AlibabaEIP) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaMongoDB ¶ added in v0.3.0
type AlibabaMongoDB struct{}
AlibabaMongoDB handles `alicloud_mongodb_instance` (ApsaraDB for MongoDB).
func (AlibabaMongoDB) Extract ¶ added in v0.3.0
func (AlibabaMongoDB) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaMongoDB) Parse ¶ added in v0.3.0
func (AlibabaMongoDB) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaNAT ¶ added in v0.3.0
type AlibabaNAT struct{}
AlibabaNAT handles `alicloud_nat_gateway`.
Priced via Alibaba Cloud BSS GetPayAsYouGoPrice with ProductCode "nat_gw" (NOT "natgateway"). ModuleList: Spec (Small/Middle/Large/Xlarge.1), quoted per DAY, so the monthly figure uses daysPerMonth (30).
func (AlibabaNAT) Extract ¶ added in v0.3.0
func (AlibabaNAT) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaNAT) Parse ¶ added in v0.3.0
func (AlibabaNAT) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaRDS ¶ added in v0.3.0
type AlibabaRDS struct{}
AlibabaRDS handles `alicloud_db_instance` (RDS).
func (AlibabaRDS) Extract ¶ added in v0.3.0
func (AlibabaRDS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaRDS) Parse ¶ added in v0.3.0
func (AlibabaRDS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaRedis ¶ added in v0.3.0
type AlibabaRedis struct{}
AlibabaRedis handles `alicloud_kvstore_instance` (ApsaraDB for Redis / Tair).
func (AlibabaRedis) Extract ¶ added in v0.3.0
func (AlibabaRedis) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaRedis) Parse ¶ added in v0.3.0
func (AlibabaRedis) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaSLB ¶ added in v0.3.0
type AlibabaSLB struct{}
AlibabaSLB handles `alicloud_slb_load_balancer` (Server Load Balancer, CLB).
Priced via Alibaba Cloud BSS GetPayAsYouGoPrice with ProductCode "slb". ModuleList (fixed-bandwidth billing): LoadBalancerSpec, InternetTrafficOut (0 = fixed bandwidth), InstanceRent, Bandwidth (Kbps).
func (AlibabaSLB) Extract ¶ added in v0.3.0
func (AlibabaSLB) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaSLB) Parse ¶ added in v0.3.0
func (AlibabaSLB) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type AlibabaVPN ¶ added in v0.3.0
type AlibabaVPN struct{}
AlibabaVPN handles `alicloud_vpn_gateway`.
Priced via Alibaba Cloud BSS GetPayAsYouGoPrice with ProductCode "vpn". ModuleList: Bandwidth.
func (AlibabaVPN) Extract ¶ added in v0.3.0
func (AlibabaVPN) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (AlibabaVPN) Parse ¶ added in v0.3.0
func (AlibabaVPN) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CBSStorage ¶
type CBSStorage struct{}
CBSStorage handles `tencentcloud_cbs_storage`.
Reference: https://cloud.tencent.com/document/api/362/16315 (InquiryPriceCreateDisks → Response.DiskPrice.OriginalPrice / DiscountPrice)
func (CBSStorage) Extract ¶
func (CBSStorage) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CBSStorage) Parse ¶
func (CBSStorage) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CDNDomain ¶ added in v0.3.14
type CDNDomain struct{}
CDNDomain handles `tencentcloud_cdn_domain`.
Like COS, CDN cost is usage-driven (traffic, requests, acceleration region) and not derivable from the plan, so it is reported as a placeholder.
func (CDNDomain) Estimate ¶ added in v0.3.14
func (CDNDomain) Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
func (CDNDomain) Extract ¶ added in v0.3.14
func (CDNDomain) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CDNDomain) Parse ¶ added in v0.3.14
func (CDNDomain) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CFSFileSystem ¶ added in v0.3.14
type CFSFileSystem struct{}
CFSFileSystem handles `tencentcloud_cfs_file_system`.
CFS cost depends on storage type, provisioned capacity (GiB) and actual GB stored — not present in the plan — so it is reported as a placeholder.
func (CFSFileSystem) Estimate ¶ added in v0.3.14
func (CFSFileSystem) Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
func (CFSFileSystem) Extract ¶ added in v0.3.14
func (CFSFileSystem) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CFSFileSystem) Parse ¶ added in v0.3.14
func (CFSFileSystem) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CLBInstance ¶
type CLBInstance struct{}
CLBInstance handles `tencentcloud_clb_instance`.
Reference: https://cloud.tencent.com/document/api/214/41708 (InquiryPriceCreateLoadBalancer → Response.Price)
CLB pricing has two dimensions:
- Instance fee (LB itself, per hour or fixed monthly for prepaid)
- Traffic/bandwidth fee (depends on internet_charge_type)
func (CLBInstance) Extract ¶
func (CLBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CLBInstance) Parse ¶
func (CLBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type COSBucket ¶ added in v0.3.14
type COSBucket struct{}
COSBucket handles `tencentcloud_cos_bucket`.
COS pricing depends on storage class, region, and actual GB stored / requests / egress — none of which are present in a Terraform plan. We return a zero-cost placeholder line with a descriptive note and route it through the StaticMapper path so it never calls the pricing engine. No price is fabricated.
func (COSBucket) Estimate ¶ added in v0.3.14
func (COSBucket) Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
func (COSBucket) Extract ¶ added in v0.3.14
func (COSBucket) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (COSBucket) Parse ¶ added in v0.3.14
func (COSBucket) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CVMInstance ¶
type CVMInstance struct{}
CVMInstance handles `tencentcloud_instance`.
Reference: https://cloud.tencent.com/document/api/213/15726 (InquiryPriceRunInstances → Response.Price.InstancePrice + BandwidthPrice)
func (CVMInstance) Extract ¶
func (CVMInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CVMInstance) Parse ¶
func (CVMInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CloudHSMInstance ¶
type CloudHSMInstance struct{}
CloudHSMInstance handles `tencentcloud_cloudhsm_instance` (Cloud HSM / Cloud HSM VSM).
Pricing API (cloudhsm): InquiryPriceBuyVsm (Inquiry, with 'y'). Docs: https://cloud.tencent.com/document/api/1300/60498
The request takes GoodsNum/PayMode/TimeSpan/TimeUnit. cloudhsm supports a prepaid mode (PayMode=1) billed by month; cloudtab always prices a single month (TimeSpan=1, TimeUnit="m") so the returned total is the monthly run-rate. Response.{OriginalCost,TotalCost} are float64 in CNY (TotalCost is the discounted/payable amount, OriginalCost the list price). Currency is echoed from the request (default CNY).
func (CloudHSMInstance) Extract ¶
func (CloudHSMInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CloudHSMInstance) Parse ¶
func (CloudHSMInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type CynosDBCluster ¶
type CynosDBCluster struct{}
CynosDBCluster handles `tencentcloud_cynosdb_cluster` (TDSQL-C).
Pricing API (cynosdb): InquirePriceCreate (SDK spells it "InquirePrice", without the 'y'). Docs: https://cloud.tencent.com/document/api/1003/48086
Terraform provider fields commonly seen:
- available_zone, cpu, memory (GB), storage_limit (GB), charge_type (PREPAID | POSTPAID), prepaid_period, instance_count
Response has two TradePrice blocks — InstancePrice and StoragePrice — each in cents (int64). PREPAID uses TotalPriceDiscount (period total); POSTPAID uses UnitPriceDiscount (hourly). We sum instance + storage.
func (CynosDBCluster) Extract ¶
func (CynosDBCluster) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (CynosDBCluster) Parse ¶
func (CynosDBCluster) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type DCDBInstance ¶
type DCDBInstance struct{}
DCDBInstance handles `tencentcloud_dcdb_instance` (TDSQL MySQL, distributed).
Pricing API (dcdb): DescribeDCDBPrice. Docs: https://cloud.tencent.com/document/api/557/16135
We request AmountUnit="pent" so Response.{OriginalPrice,Price} come back as int64 cents (value/100 = CNY). Paymode is the lowercase "prepaid"/"postpaid". For PREPAID the value is the total for the requested Period; for POSTPAID it is an hourly rate. cloudtab always prices a single month (Period=1).
func (DCDBInstance) Extract ¶
func (DCDBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (DCDBInstance) Parse ¶
func (DCDBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type DomainRegistration ¶
type DomainRegistration struct{}
DomainRegistration handles `tencentcloud_domain_registration`.
Pricing API (domain): DescribeDomainPriceList (Describe, not Inquiry). Docs: https://cloud.tencent.com/document/api/242/48941
Domain pricing is fundamentally different from instance products: the API returns a PriceList of {Tld, Year, Operation, Price, RealPrice} tuples. There is no region, no charge type, and prices are one-off yearly fees, not monthly instance run-rates. We query the "new" (first-purchase) price for 1 year for the resource's TLD, then divide by 12 to express a comparable monthly figure.
IMPORTANT — pricing unit: the SDK types Price/RealPrice as uint64 but the API docs and struct comments (domain list price/domain current price) do NOT state a unit. Empirically this endpoint returns whole-yuan (CNY) integers (e.g. 55 for a ¥55/year .com), NOT cents. We therefore treat the value as CNY directly. If a future SDK/API revision switches to cents, change domainPriceUnitDivisor to 100.0.
func (DomainRegistration) Extract ¶
func (DomainRegistration) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (DomainRegistration) Parse ¶
func (DomainRegistration) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type ECMInstance ¶
type ECMInstance struct{}
ECMInstance handles `tencentcloud_ecm_instance` (Edge Computing Machine).
Pricing API (ecm): DescribePriceRunInstance. Docs: https://cloud.tencent.com/document/api/1108/42030
InstanceChargeType is an int enum: 0 = resource-postpaid, 1 = hourly-postpaid, 2 = monthly-postpaid. ECM has no PREPAID mode. Response.InstancePrice. {OriginalPrice,DiscountPrice} are uint64 in cents (value/100 = CNY); the value is an hourly rate for the hourly charge types.
func (ECMInstance) Extract ¶
func (ECMInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (ECMInstance) Parse ¶
func (ECMInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type EIP ¶
type EIP struct{}
EIP handles `tencentcloud_eip`.
Note: Tencent Cloud's VPC SDK does not expose an InquiryPrice* API for EIP. Real EIP cost depends on the charge type and, for traffic-based billing, on actual monthly traffic which is not present in a Terraform plan. We therefore return a zero-cost placeholder line with a descriptive note and route it through the StaticMapper path so it never calls the pricing engine.
func (EIP) Estimate ¶
func (EIP) Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
func (EIP) Extract ¶
func (EIP) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (EIP) Parse ¶
func (EIP) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type GAAPProxy ¶
type GAAPProxy struct{}
GAAPProxy handles `tencentcloud_gaap_proxy` (Global Application Acceleration).
Pricing API (gaap): InquiryPriceCreateProxy. Docs: https://cloud.tencent.com/document/api/608/37569
GAAP quotes a DAILY proxy price. Response.{ProxyDailyPrice, DiscountProxyDailyPrice} are float64 in CNY/day. We convert to a monthly run-rate with the shared 730h month (≈30.4 days). BillingType is an int: 0 = by bandwidth, 1 = by flow.
func (GAAPProxy) Extract ¶
func (GAAPProxy) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (GAAPProxy) Parse ¶
func (GAAPProxy) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiCCE ¶ added in v0.3.0
type HuaweiCCE struct{}
HuaweiCCE handles `huaweicloud_cce_cluster` (CCE).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiCCE) Extract ¶ added in v0.3.0
func (HuaweiCCE) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiCCE) Parse ¶ added in v0.3.0
func (HuaweiCCE) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiDCS ¶ added in v0.3.0
type HuaweiDCS struct{}
HuaweiDCS handles `huaweicloud_dcs_instance` (DCS).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiDCS) Extract ¶ added in v0.3.0
func (HuaweiDCS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiDCS) Parse ¶ added in v0.3.0
func (HuaweiDCS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiDDS ¶ added in v0.3.0
type HuaweiDDS struct{}
HuaweiDDS handles `huaweicloud_dds_instance` (DDS).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiDDS) Extract ¶ added in v0.3.0
func (HuaweiDDS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiDDS) Parse ¶ added in v0.3.0
func (HuaweiDDS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiECS ¶ added in v0.3.0
type HuaweiECS struct{}
HuaweiECS handles `huaweicloud_compute_instance` (ECS).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiECS) Extract ¶ added in v0.3.0
func (HuaweiECS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiECS) Parse ¶ added in v0.3.0
func (HuaweiECS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiEIP ¶ added in v0.3.0
type HuaweiEIP struct{}
HuaweiEIP handles `huaweicloud_vpc_eip` (elastic IP / bandwidth).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings. An EIP is composed of two billable parts, both modeled as separate product_infos:
- The public IP itself -> cloud_service_type "hws.service.type.vpc", resource_type "hws.resource.type.ip", resource_spec is the EIP line type (e.g. "5_bgp" dynamic BGP, "5_sbgp" static BGP). Billed by Duration.
- The bandwidth attachment -> resource_type "hws.resource.type.bandwidth". Bandwidth is a LINEAR product, so resource_size (Mbps) + size_measure_id (15 = Mbps) are mandatory. It is billed by Duration (by-bandwidth) or by upflow (by-traffic) depending on the plan's charge_mode.
func (HuaweiEIP) Extract ¶ added in v0.3.0
func (HuaweiEIP) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiEIP) Parse ¶ added in v0.3.0
func (HuaweiEIP) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiELB ¶ added in v0.3.0
type HuaweiELB struct{}
HuaweiELB handles `huaweicloud_elb_loadbalancer` (ELB).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiELB) Extract ¶ added in v0.3.0
func (HuaweiELB) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiELB) Parse ¶ added in v0.3.0
func (HuaweiELB) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiEVS ¶ added in v0.3.0
type HuaweiEVS struct{}
HuaweiEVS handles `huaweicloud_evs_volume` (EVS disk).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiEVS) Extract ¶ added in v0.3.0
func (HuaweiEVS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiEVS) Parse ¶ added in v0.3.0
func (HuaweiEVS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiNAT ¶ added in v0.3.0
type HuaweiNAT struct{}
HuaweiNAT handles `huaweicloud_nat_gateway` (NAT Gateway).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiNAT) Extract ¶ added in v0.3.0
func (HuaweiNAT) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiNAT) Parse ¶ added in v0.3.0
func (HuaweiNAT) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type HuaweiRDS ¶ added in v0.3.0
type HuaweiRDS struct{}
HuaweiRDS handles `huaweicloud_rds_instance` (RDS).
Priced via Huawei Cloud BSS ListOnDemandResourceRatings.
func (HuaweiRDS) Extract ¶ added in v0.3.0
func (HuaweiRDS) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (HuaweiRDS) Parse ¶ added in v0.3.0
func (HuaweiRDS) Parse(_ pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type LighthouseInstance ¶
type LighthouseInstance struct{}
LighthouseInstance handles `tencentcloud_lighthouse_instance`.
Pricing API (lighthouse): InquirePriceCreateInstances (SDK spells it "InquirePrice", without the 'y'). Docs: https://cloud.tencent.com/document/api/1207/47576
Lighthouse is a prepaid, bundle-priced product: you buy a BundleId for a number of months. Response.Price.InstancePrice.{OriginalPrice,DiscountPrice} is in CNY and is the total for the requested Period. cloudtab always prices a single month (Period=1) so the returned price is the monthly run-rate.
func (LighthouseInstance) Extract ¶
func (LighthouseInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (LighthouseInstance) Parse ¶
func (LighthouseInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type Mapper ¶
type Mapper interface {
Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
}
Mapper is the contract every resource type implements.
type MariaDBInstance ¶
type MariaDBInstance struct{}
MariaDBInstance handles `tencentcloud_mariadb_instance`.
Pricing API (mariadb): DescribePrice. Docs: https://cloud.tencent.com/document/api/237/16177
Terraform provider fields commonly seen:
- zones (first used as Zone), node_count, memory (GB), storage (GB), period (months), instance_charge_type / charge_type
Response.{Price,OriginalPrice} are int64 in cents (cents). We request AmountUnit="pent" for an explicit unit and divide by 100 to get CNY. The returned figure is the total for the requested Period, so PREPAID is a period total and POSTPAID is an hourly rate.
func (MariaDBInstance) Extract ¶
func (MariaDBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (MariaDBInstance) Parse ¶
func (MariaDBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type MongoDBInstance ¶
type MongoDBInstance struct{}
MongoDBInstance handles `tencentcloud_mongodb_instance`.
Pricing API (mongodb): InquirePriceCreateDBInstances (SDK spells it "InquirePrice", without the 'y'). Docs: https://cloud.tencent.com/document/api/240/38571
Terraform provider fields commonly seen:
- available_zone, memory (GB), volume (GB), engine_version, machine_type, charge_type, prepaid_period, node_num
Response.Price.{UnitPrice,OriginalPrice,DiscountPrice} is in CNY. There is no ChargeUnit field: PREPAID prices are a monthly total, POSTPAID an hourly rate, decided from the charge type in the request.
func (MongoDBInstance) Extract ¶
func (MongoDBInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (MongoDBInstance) Parse ¶
func (MongoDBInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type MySQLInstance ¶
type MySQLInstance struct{}
MySQLInstance handles `tencentcloud_mysql_instance`.
Pricing API (cdb): DescribeDBPrice. Docs: https://cloud.tencent.com/document/api/236/15866
Terraform provider fields commonly seen: - availability_zone, mem_size, volume_size, charge_type, prepaid_period - cpu, instance_role, device_type
We normalize charge_type to cdb.PayType: - PREPAID -> PRE_PAID - POSTPAID -> HOUR_PAID
Design decision — hourly → monthly conversion: Unlike CVM/CBS/CLB which return InquiryPrice* responses with a ChargeUnit field (handled by monthlyFromPrice), the CDB DescribeDBPrice response does NOT include a ChargeUnit. The Price field is always in CNY/hour for HOUR_PAID and CNY/month for PRE_PAID. Since we cannot use monthlyFromPrice here (no ChargeUnit), we multiply by hoursPerMonth (=730) directly for POSTPAID instances. This is intentional and matches Tencent Cloud console behavior.
func (MySQLInstance) Extract ¶
func (MySQLInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (MySQLInstance) Parse ¶
func (MySQLInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type PostgreSQLInstance ¶
type PostgreSQLInstance struct{}
PostgreSQLInstance handles `tencentcloud_postgresql_instance`.
Pricing API (postgres): InquiryPriceCreateDBInstances. Docs: https://cloud.tencent.com/document/api/409/16777
Terraform provider fields commonly seen: - availability_zone, spec_code, storage, instance_charge_type, prepaid_period - cpu, memory
func (PostgreSQLInstance) Extract ¶
func (PostgreSQLInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (PostgreSQLInstance) Parse ¶
func (PostgreSQLInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type RedisInstance ¶
type RedisInstance struct{}
RedisInstance handles `tencentcloud_redis_instance`.
Pricing API (redis): InquiryPriceCreateInstance. Docs: https://cloud.tencent.com/document/api/239/41159
Terraform provider fields commonly seen: - availability_zone, type_id, mem_size, charge_type, prepaid_period - redis_shard_num, redis_replicas_num, product_version
BillingMode mapping: - POSTPAID -> 0 (pay-as-you-go, treated as hourly for monthly estimate) - PREPAID -> 1 (fixed period price)
func (RedisInstance) Extract ¶
func (RedisInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (RedisInstance) Parse ¶
func (RedisInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() *Registry
DefaultRegistry returns a shared Registry pre-loaded with all supported resource types. It is safe for concurrent use.
func NewRegistry ¶ added in v0.3.4
func NewRegistry() *Registry
NewRegistry returns an empty Registry. Use Register to add mappers. Most callers want DefaultRegistry (pre-loaded with all supported types); this is for building a custom or test-only registry.
func (*Registry) Keys ¶ added in v0.3.6
Keys returns all registered Terraform resource type names. Order is undefined.
type SCFFunction ¶ added in v0.3.14
type SCFFunction struct{}
SCFFunction handles `tencentcloud_scf_function`.
SCF cost depends on invocations, execution duration and memory (GB-s) — none of which are in the plan — so it is reported as a placeholder.
func (SCFFunction) Estimate ¶ added in v0.3.14
func (SCFFunction) Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
func (SCFFunction) Extract ¶ added in v0.3.14
func (SCFFunction) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (SCFFunction) Parse ¶ added in v0.3.14
func (SCFFunction) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type SQLServerInstance ¶
type SQLServerInstance struct{}
SQLServerInstance handles `tencentcloud_sqlserver_instance`.
Pricing API (sqlserver): InquiryPriceCreateDBInstances. Docs: https://cloud.tencent.com/document/api/238/19992
Response.{OriginalPrice,Price} are int64 in cents (value/100 = CNY). For PREPAID the value is the total for the requested Period; for POSTPAID it is an hourly rate. cloudtab always prices a single month (Period=1) so PREPAID == monthly.
func (SQLServerInstance) Extract ¶
func (SQLServerInstance) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (SQLServerInstance) Parse ¶
func (SQLServerInstance) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type StaticMapper ¶
type StaticMapper interface {
Mapper
Estimate(r parser.PlannedResource) ([]output.CostComponent, error)
}
StaticMapper is an optional extension for resources whose price cannot be fetched from a Tencent InquiryPrice* API. When a Mapper implements this interface, priceReport uses Estimate directly and skips the pricing engine.
type VPNGateway ¶
type VPNGateway struct{}
VPNGateway handles `tencentcloud_vpn_gateway`.
Pricing API (vpc): InquiryPriceCreateVpnGateway. Docs: https://cloud.tencent.com/document/api/215/17517
Terraform provider fields commonly seen:
- bandwidth (Mbps), charge_type (PREPAID | POSTPAID_BY_HOUR), prepaid_period, type (IPSEC | SSL), max_connection (SSL only)
Response.Price.InstancePrice.{UnitPrice,DiscountPrice,ChargeUnit} is in CNY.
func (VPNGateway) Extract ¶
func (VPNGateway) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (VPNGateway) Parse ¶
func (VPNGateway) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
type YunjingLicense ¶
type YunjingLicense struct{}
YunjingLicense handles `tencentcloud_cwp_license_order` (Cloud Workload Protection / Host Security professional-version license).
Pricing API (yunjing): InquiryPriceOpenProVersionPrepaid (Inquiry, with 'y'). Docs: https://cloud.tencent.com/document/api/296/19836
The professional version is a prepaid, per-machine license. The request takes a ChargePrepaid{Period,RenewFlag} block plus a Machines list; cloudtab always prices a single month (Period=1) so the returned total is the monthly run-rate. Response.{OriginalPrice,DiscountPrice} are float64 in CNY for the whole requested period (no per-instance currency field; CNY is implied).
func (YunjingLicense) Extract ¶
func (YunjingLicense) Extract(r parser.PlannedResource) (pricing.PriceRequest, error)
func (YunjingLicense) Parse ¶
func (YunjingLicense) Parse(req pricing.PriceRequest, raw []byte) ([]output.CostComponent, error)
Source Files
¶
- alibaba_disk.go
- alibaba_ecs.go
- alibaba_eip.go
- alibaba_nat.go
- alibaba_rds.go
- alibaba_redis_mongo.go
- alibaba_slb.go
- alibaba_vpn.go
- attrs.go
- aws_common.go
- aws_docdb_neptune.go
- aws_dynamodb.go
- aws_ebs.go
- aws_ec2.go
- aws_elasticache.go
- aws_elb.go
- aws_fixed.go
- aws_opensearch.go
- aws_rds.go
- aws_rds_cluster.go
- aws_redshift.go
- aws_streaming.go
- cbs_storage.go
- clb_instance.go
- cloudhsm_instance.go
- cvm_instance.go
- cynosdb_cluster.go
- dcdb_instance.go
- domain_registration.go
- ecm_instance.go
- eip.go
- gaap_proxy.go
- huawei_cce.go
- huawei_dcs.go
- huawei_dds.go
- huawei_ecs.go
- huawei_eip.go
- huawei_elb.go
- huawei_evs.go
- huawei_nat.go
- huawei_rds.go
- lighthouse_instance.go
- mariadb_instance.go
- mongodb_instance.go
- mysql_instance.go
- postgresql_instance.go
- pricehelper.go
- redis_instance.go
- registry.go
- sqlserver_instance.go
- tencentcloud_static.go
- vpn_gateway.go
- yunjing_license.go