diff --git a/infracost-usage-example.yml b/infracost-usage-example.yml index b63a5753e5a..5d1018b81d7 100644 --- a/infracost-usage-example.yml +++ b/infracost-usage-example.yml @@ -7,11 +7,11 @@ resource_type_default_usage: aws_lambda_function: monthly_requests: 100000 # Monthly requests to the Lambda function. request_duration_ms: 500 # Average duration of each request in milliseconds. - ibm_container_vpc_cluster: + ibm_container_vpc_cluster: monthly_instance_hours: 730 - ibm_container_vpc_worker_pool: + ibm_container_vpc_worker_pool: monthly_instance_hours: 730 - ibm_cos_bucket: + ibm_cos_bucket: accelerated_archive_capacity: 1000 accelerated_archive_restore: 0 archive_capacity: 1000 @@ -23,21 +23,21 @@ resource_type_default_usage: monthly_average_capacity: 1000 monthly_data_retrieval: 1000 public_standard_egress: 1 - ibm_is_flow_log: + ibm_is_flow_log: transmitted_gb: 100 - ibm_is_instance: + ibm_is_instance: monthly_instance_hours: 730 ibm_is_lb: gigabyte_processed: 5 monthly_instance_hours: 730 - ibm_is_volume: + ibm_is_volume: monthly_instance_hours: 730 - ibm_is_vpc: + ibm_is_vpc: gigabyte_transmitted_outbounds: 5 - ibm_is_vpn_gateway: + ibm_is_vpn_gateway: monthly_connection_hours: 730 monthly_instance_hours: 730 - ibm_pi_instance: + ibm_pi_instance: cloud_storage_solution: 0 db2_web_query: 0 epic: 0 @@ -45,9 +45,9 @@ resource_type_default_usage: monthly_instance_hours: 730 rational_dev_studio_licenses: 0 storage: 20 - ibm_pi_volume: + ibm_pi_volume: monthly_instance_hours: 730 - ibm_resource_instance: + ibm_resource_instance: appconnect_gigabyte_transmitted_outbounds: 1 appconnect_thousand_runs: 1 appconnect_vcpu_hours: 730 @@ -97,7 +97,7 @@ resource_type_default_usage: messagehub_CAPACITY_UNIT_HOURS: 1 messagehub_qty_capacity_units: 1 messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1 - messagehub_qty_capacity_units_additional: 1 + messagehub_qty_capacity_units_additional: 1 messagehub_CAPACITY_UNIT_HOURS_MIRRORING: 1 messagehub_qty_capacity_units_mirroring: 1 messagehub_INSTANCE_HOURS: 1 @@ -105,8 +105,19 @@ resource_type_default_usage: messagehub_TERABYTE_HOURS: 1 messagehub_qty_terabytes: 1 messagehub_GIGABYTE_TRANSMITTED_OUTBOUNDS: 1 - - ibm_tg_gateway: + event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL: 1 + event-notifications_MILLION_INGESTED_EVENTS: 1 + event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS: 0 + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 0 + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 0 + event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS: 0 + event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL: 0 + event-notifications_PUSH_DESTINATION_INSTANCES: 1 + event-notifications_PUSH_PREPROD_DESTINATION_INSTANCES: 0 + event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY: 1 + event-notifications_RESOURCE_UNITS_NUMBER_SETUP: 1 + + ibm_tg_gateway: connection: 3 data_transfer_global: 1000 data_transfer_local: 1000 @@ -126,13 +137,13 @@ resource_usage: monthly_requests: 20000 # Monthly private certificate requests. aws_api_gateway_rest_api.my_rest_api: - monthly_requests: 100000000 # Monthly requests to the Rest API Gateway. + monthly_requests: 100000000 # Monthly requests to the Rest API Gateway. aws_apigatewayv2_api.my_v2_api: - monthly_requests: 100000000 # Monthly requests to the HTTP API Gateway. - request_size_kb: 512 # Average request size sent to the HTTP API Gateway in KB. Requests are metered in 512KB increments, maximum size is 10MB. - monthly_messages: 1500000000 # Monthly number of messages sent to the Websocket API Gateway. - message_size_kb: 32 # Average size of the messages sent to the Websocket API Gateway in KB. Messages are metered in 32 KB increments, maximum size is 128KB. + monthly_requests: 100000000 # Monthly requests to the HTTP API Gateway. + request_size_kb: 512 # Average request size sent to the HTTP API Gateway in KB. Requests are metered in 512KB increments, maximum size is 10MB. + monthly_messages: 1500000000 # Monthly number of messages sent to the Websocket API Gateway. + message_size_kb: 32 # Average size of the messages sent to the Websocket API Gateway in KB. Messages are metered in 32 KB increments, maximum size is 128KB. monthly_connection_mins: 10000000 # Monthly total connection minutes to Websockets. aws_autoscaling_group.my_asg: @@ -172,16 +183,16 @@ resource_usage: monthly_insight_events: 400000 # Monthly CloudTrail Insight events aws_cloudwatch_event_bus.my_events: - monthly_custom_events: 1000000 # Monthly custom events published. Each 64 KB chunk of payload is billed as 1 event. - monthly_third_party_events: 2000000 # Monthly third-party and cross-account events published. Each 64 KB chunk of payload is billed as 1 event. - monthly_archive_processing_gb: 100 # Monthly archive event processing in GB. - archive_storage_gb: 200 # Archive storage used for event replay in GB. - monthly_schema_discovery_events: 1000000 # Monthly events ingested for schema discovery. Each 8 KB chunk of payload is billed as 1 event. + monthly_custom_events: 1000000 # Monthly custom events published. Each 64 KB chunk of payload is billed as 1 event. + monthly_third_party_events: 2000000 # Monthly third-party and cross-account events published. Each 64 KB chunk of payload is billed as 1 event. + monthly_archive_processing_gb: 100 # Monthly archive event processing in GB. + archive_storage_gb: 200 # Archive storage used for event replay in GB. + monthly_schema_discovery_events: 1000000 # Monthly events ingested for schema discovery. Each 8 KB chunk of payload is billed as 1 event. aws_cloudwatch_log_group.my_log_group: - storage_gb: 1000 # Total data stored by CloudWatch logs in GB. + storage_gb: 1000 # Total data stored by CloudWatch logs in GB. monthly_data_ingested_gb: 1000 # Monthly data ingested by CloudWatch logs in GB. - monthly_data_scanned_gb: 200 # Monthly data scanned by CloudWatch logs insights in GB. + monthly_data_scanned_gb: 200 # Monthly data scanned by CloudWatch logs insights in GB. aws_codebuild_project.my_project: monthly_build_mins: 10000 # Monthly total duration of builds in minutes. Each build is rounded up to the nearest minute. @@ -190,7 +201,7 @@ resource_usage: monthly_rule_evaluations: 1000000 # Monthly config rule evaluations. aws_config_configuration_recorder.my_config: - monthly_config_items: 10000 # Monthly config item records. + monthly_config_items: 10000 # Monthly config item records. monthly_custom_config_items: 20000 # Monthly custom config item records. aws_config_organization_custom_rule.my_config: @@ -200,63 +211,63 @@ resource_usage: monthly_rule_evaluations: 10000 # Monthly config rule evaluations. aws_data_transfer.my_region: - region: us-east-1 # Region the data transfer is originating from. - monthly_intra_region_gb: 1000 # Monthly data transferred between availability zones in the region. Infracost multiplies this by two to account for AWS charging in-bound and out-bound rates. + region: us-east-1 # Region the data transfer is originating from. + monthly_intra_region_gb: 1000 # Monthly data transferred between availability zones in the region. Infracost multiplies this by two to account for AWS charging in-bound and out-bound rates. monthly_outbound_us_east_to_us_east_gb: 500 # Monthly data transferred between US east regions. NOTE: this is only valid if the region is a us-east region. - monthly_outbound_other_regions_gb: 750 # Monthly data transferred to other AWS regions. - monthly_outbound_internet_gb: 5000 # Monthly data transferred to the Internet. + monthly_outbound_other_regions_gb: 750 # Monthly data transferred to other AWS regions. + monthly_outbound_internet_gb: 5000 # Monthly data transferred to the Internet. aws_db_instance.my_db: - additional_backup_storage_gb: 1000 # Amount of backup storage used that is in excess of 100% of the storage size for all databases in GB. + additional_backup_storage_gb: 1000 # Amount of backup storage used that is in excess of 100% of the storage size for all databases in GB. monthly_standard_io_requests: 10000 # Monthly number of input/output requests for database. monthly_additional_performance_insights_requests: 10000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier. - reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. - reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront (only for 1_year term), partial_upfront, all_upfront. + reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. + reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront (only for 1_year term), partial_upfront, all_upfront. aws_directory_service_directory.my_directory: additional_domain_controllers: 3 # The number of domain controllers in the directory service provisioned in addition to the minimum 2 controllers shared_accounts: 8 # Number of accounts that Microsoft AD directory is shared with aws_docdb_cluster.my_cluster: - backup_storage_gb: 10000 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. + backup_storage_gb: 10000 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. aws_docdb_cluster_instance.my_db: - data_storage_gb: 1000 # Total storage for cluster in GB. + data_storage_gb: 1000 # Total storage for cluster in GB. monthly_io_requests: 100000000 # Monthly number of input/output requests for cluster. monthly_cpu_credit_hrs: 100 # Monthly CPU credits used over the instance baseline in vCPU-hours, only applicable for T3 instances. aws_docdb_cluster_snapshot.my_snapshot: - backup_storage_gb: 10000 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. + backup_storage_gb: 10000 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. aws_dx_connection.my_dx_connection: monthly_outbound_region_to_dx_location_gb: 100 # (DEPRECATED use monthly_outbound_from_region_to_dx_connection_location instead) Monthly outbound data transferred from AWS region to DX location in GB. monthly_outbound_from_region_to_dx_connection_location: us_east_1: 200 # Monthly outbound data transferred to the DX location from us-east-1 in GB eu_west_2: 100 # Monthly outbound data transferred to the DX location from eu-west-2 in GB - dx_virtual_interface_type: private # Interface type impacts outbound data transfer costs over DX, can be: private, public. - dx_connection_type: dedicated # Connection type impacts the per-port hourly price, can be: dedicated, hosted. + dx_virtual_interface_type: private # Interface type impacts outbound data transfer costs over DX, can be: private, public. + dx_connection_type: dedicated # Connection type impacts the per-port hourly price, can be: dedicated, hosted. aws_dx_gateway_association.my_gateway: monthly_data_processed_gb: 100 # Monthly data processed by the DX gateway association per month in GB. aws_dynamodb_table.my_table: - monthly_write_request_units: 3000000 # Monthly write request units in (used for on-demand DynamoDB). - monthly_read_request_units: 8000000 # Monthly read request units in (used for on-demand DynamoDB). - storage_gb: 230 # Total storage for tables in GB. - pitr_backup_storage_gb: 2300 # Total storage for Point-In-Time Recovery (PITR) backups in GB. - on_demand_backup_storage_gb: 460 # Total storage for on-demand backups in GB. - monthly_data_restored_gb: 230 # Monthly size of restored data in GB. + monthly_write_request_units: 3000000 # Monthly write request units in (used for on-demand DynamoDB). + monthly_read_request_units: 8000000 # Monthly read request units in (used for on-demand DynamoDB). + storage_gb: 230 # Total storage for tables in GB. + pitr_backup_storage_gb: 2300 # Total storage for Point-In-Time Recovery (PITR) backups in GB. + on_demand_backup_storage_gb: 460 # Total storage for on-demand backups in GB. + monthly_data_restored_gb: 230 # Monthly size of restored data in GB. monthly_streams_read_request_units: 2 # Monthly streams read request units. aws_ebs_snapshot.my_snapshot: - monthly_list_block_requests: 1000000 # Monthly number of ListChangedBlocks and ListSnapshotBlocks requests. - monthly_get_block_requests: 100000 # Monthly number of GetSnapshotBlock requests (block size is 512KiB). - monthly_put_block_requests: 100000 # Monthly number of PutSnapshotBlock requests (block size is 512KiB). - fast_snapshot_restore_hours: 100 # Monthly number of DSU-hours for Fast snapshot restore + monthly_list_block_requests: 1000000 # Monthly number of ListChangedBlocks and ListSnapshotBlocks requests. + monthly_get_block_requests: 100000 # Monthly number of GetSnapshotBlock requests (block size is 512KiB). + monthly_put_block_requests: 100000 # Monthly number of PutSnapshotBlock requests (block size is 512KiB). + fast_snapshot_restore_hours: 100 # Monthly number of DSU-hours for Fast snapshot restore aws_ebs_volume.my_standard_volume: monthly_standard_io_requests: 10000000 # Monthly I/O requests for standard volume (Magnetic storage). - + aws_ec2_host.my_host: reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront, partial_upfront, all_upfront. @@ -268,9 +279,9 @@ resource_usage: storage_gb: 1 # Total size of ECR repository in GB. aws_efs_file_system.my_file_system: - storage_gb: 230 # Total storage for Standard class in GB. - infrequent_access_storage_gb: 100 # Total storage for Infrequent Access class in GB. - monthly_infrequent_access_read_gb: 50 # Monthly infrequent access read requests in GB. + storage_gb: 230 # Total storage for Standard class in GB. + infrequent_access_storage_gb: 100 # Total storage for Infrequent Access class in GB. + monthly_infrequent_access_read_gb: 50 # Monthly infrequent access read requests in GB. monthly_infrequent_access_write_gb: 100 # Monthly infrequent access write requests in GB. aws_eks_node_group.my_instance: @@ -284,32 +295,32 @@ resource_usage: aws_elastic_beanstalk_environment.my_eb_environment: db: - additional_backup_storage_gb: 1000 # Amount of backup storage used that is in excess of 100% of the storage size for all databases in GB. + additional_backup_storage_gb: 1000 # Amount of backup storage used that is in excess of 100% of the storage size for all databases in GB. monthly_standard_io_requests: 10000 # Monthly number of input/output requests for database. monthly_additional_performance_insights_requests: 10000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier. ec2: monthly_cpu_credit_hrs: 350 # Number of hours in the month where the instance is expected to burst. Only applicable with t2, t3 & t4 Instance types. T2 requires credit_specification to be unlimited. cloudwatch: - storage_gb: 1000 # Total data stored by CloudWatch logs in GB. + storage_gb: 1000 # Total data stored by CloudWatch logs in GB. monthly_data_ingested_gb: 1000 # Monthly data ingested by CloudWatch logs in GB. - monthly_data_scanned_gb: 200 # Monthly data scanned by CloudWatch logs insights in GB. + monthly_data_scanned_gb: 200 # Monthly data scanned by CloudWatch logs insights in GB. lb: - new_connections: 500000 # Number of newly established connections per second on average. + new_connections: 500000 # Number of newly established connections per second on average. active_connections: 100000 # Number of active connections per minute on average. - processed_bytes_gb: 25000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. - rule_evaluations: 10000 # Number of rule evaluations on application/network load balancers + processed_bytes_gb: 25000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. + rule_evaluations: 10000 # Number of rule evaluations on application/network load balancers elb: monthly_data_processed_gb: 10000 # Monthly data processed on classic loadbalaner - + aws_elasticache_cluster.my_redis_snapshot: snapshot_storage_size_gb: 10000 # Size of Redis snapshots in GB. - reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. - reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances. Can be: no_upfront, partial_upfront, all_upfront for standard offering class. Can be: heavy_utilization, medium_utilization, light utilization for legacy offering class. + reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. + reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances. Can be: no_upfront, partial_upfront, all_upfront for standard offering class. Can be: heavy_utilization, medium_utilization, light utilization for legacy offering class. aws_elasticache_replication_group.my_redis_replication_snapshot: snapshot_storage_size_gb: 10000 # Size of Redis snapshots in GB. - reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. - reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances. Can be: no_upfront, partial_upfront, all_upfront for standard offering class. Can be: heavy_utilization, medium_utilization, light utilization for legacy offering class. + reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. + reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances. Can be: no_upfront, partial_upfront, all_upfront for standard offering class. Can be: heavy_utilization, medium_utilization, light utilization for legacy offering class. aws_elb.my_elb: monthly_data_processed_gb: 10000 # Monthly data processed by a Classic Load Balancer in GB. @@ -335,7 +346,7 @@ resource_usage: india: 7234 # India, Indonesia, Philippines, Thailand aws_glue_catalog_database.my_db: - monthly_objects: 100000 # Monthly number of objects stored above the free one million object storage limit. + monthly_objects: 100000 # Monthly number of objects stored above the free one million object storage limit. monthly_requests: 100000 # Monthly number of requests to the db beyond the free one million requests limit. aws_glue_crawler.my_crawler: @@ -375,30 +386,30 @@ resource_usage: request_duration_ms: 500 # Average duration of each request in milliseconds. aws_alb.my_alb: - new_connections: 10000 # Number of newly established connections per second on average. + new_connections: 10000 # Number of newly established connections per second on average. active_connections: 10000 # Number of active connections per minute on average. - processed_bytes_gb: 1000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. - rule_evaluations: 10000 # The product of number of rules processed by the load balancer and the request rate. + processed_bytes_gb: 1000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. + rule_evaluations: 10000 # The product of number of rules processed by the load balancer and the request rate. aws_lb.my_lb: - new_connections: 10000 # Number of newly established connections per second on average. + new_connections: 10000 # Number of newly established connections per second on average. active_connections: 10000 # Number of active connections per minute on average. - processed_bytes_gb: 1000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. - rule_evaluations: 10000 # The product of number of rules processed by the load balancer and the request rate. + processed_bytes_gb: 1000 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. + rule_evaluations: 10000 # The product of number of rules processed by the load balancer and the request rate. aws_nat_gateway.my_nat_gateway: monthly_data_processed_gb: 10 # Monthly data processed by the NAT Gateway in GB. aws_neptune_cluster.my_cluster: - storage_gb: 100 # Total storage for the cluster in GB. - monthly_io_requests: 10000000 # Monthly number of input/output requests for cluster. - backup_storage_gb: 1000 # Total storage used for backups in GB. + storage_gb: 100 # Total storage for the cluster in GB. + monthly_io_requests: 10000000 # Monthly number of input/output requests for cluster. + backup_storage_gb: 1000 # Total storage used for backups in GB. aws_neptune_cluster_instance.my_cluster_instance: - monthly_cpu_credit_hrs: 10 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type. + monthly_cpu_credit_hrs: 10 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type. aws_neptune_cluster_snapshot.my_cluster_snapshot: - backup_storage_gb: 1000 # Total storage used for backup snapshots in GB. + backup_storage_gb: 1000 # Total storage used for backup snapshots in GB. aws_networkfirewall_firewall.my_firewall: monthly_data_processed_gb: 100 # Monthly data processed by the Network Firewall in GB. @@ -407,27 +418,27 @@ resource_usage: storage_size_gb: 12 # Data storage per instance in GB. aws_mwaa_environment.my_aws_mwaa_environment: - additional_workers: 2.5 # Average number of monthly additional worker instances - additional_schedulers: 2 # Average number of monthly additional scheduler instances - meta_database_gb: 1000 # Total storage used for meta database + additional_workers: 2.5 # Average number of monthly additional worker instances + additional_schedulers: 2 # Average number of monthly additional scheduler instances + meta_database_gb: 1000 # Total storage used for meta database aws_rds_cluster.my_cluster: - capacity_units_per_hr: 50 # Number of aurora capacity units per hour. Only used when engine_mode is "serverless" - storage_gb: 200 # Storage amount in GB allocated to the aurora cluster. - write_requests_per_sec: 100 # Total number of reads per second for the cluster. - read_requests_per_sec: 100 # Total number of writes per second for the cluster. - backup_snapshot_size_gb: 200 # Individual storage size for backup snapshots, used in conjunction with resource parameter "backup_retention_period". - average_statements_per_hr: 10000 # Number of statements generated per hour when backtrack is enabled. Only available for MySQl-compatible Aurora + capacity_units_per_hr: 50 # Number of aurora capacity units per hour. Only used when engine_mode is "serverless" + storage_gb: 200 # Storage amount in GB allocated to the aurora cluster. + write_requests_per_sec: 100 # Total number of reads per second for the cluster. + read_requests_per_sec: 100 # Total number of writes per second for the cluster. + backup_snapshot_size_gb: 200 # Individual storage size for backup snapshots, used in conjunction with resource parameter "backup_retention_period". + average_statements_per_hr: 10000 # Number of statements generated per hour when backtrack is enabled. Only available for MySQl-compatible Aurora change_records_per_statement: 0.38 # Records changed per statement executed. - backtrack_window_hrs: 24 # The duration window for which Aurora will support rewinding the DB cluster to a specific point in time. - snapshot_export_size_gb: 200 # Size of snapshot that's exported to s3 in parquet format. + backtrack_window_hrs: 24 # The duration window for which Aurora will support rewinding the DB cluster to a specific point in time. + snapshot_export_size_gb: 200 # Size of snapshot that's exported to s3 in parquet format. aws_rds_cluster_instance.my_cluster: - monthly_cpu_credit_hrs: 24 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type. + monthly_cpu_credit_hrs: 24 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type. vcpu_count: 2 # # (DEPRECATED this is now calculated automatically) Number of virtual CPUs allocated to your "t3" instance type. Currently instances with 2 vCPUs are available. monthly_additional_performance_insights_requests: 10000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier. - reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. - reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront (only for 1_year term), partial_upfront, all_upfront. + reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year. + reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront (only for 1_year term), partial_upfront, all_upfront. aws_redshift_cluster.with_usage: managed_storage_gb: 10000 @@ -439,9 +450,9 @@ resource_usage: endpoint_type: aws # Type of health check endpoint to query, can be: aws, non_aws. aws_route53_record.my_record: - monthly_standard_queries: 1100000000 # Monthly number of Standard queries. + monthly_standard_queries: 1100000000 # Monthly number of Standard queries. monthly_latency_based_queries: 1200000000 # Monthly number of Latency Based Routing queries. - monthly_geo_queries: 1500000000 # Monthly number of Geo DNS and Geoproximity queries. + monthly_geo_queries: 1500000000 # Monthly number of Geo DNS and Geoproximity queries. aws_route53_resolver_endpoint.my_endpoint: monthly_queries: 20000000000 # Monthly number of DNS queries processed through the endpoints. @@ -455,63 +466,63 @@ resource_usage: aws_s3_bucket_lifecycle_configuration.my_bucket_lifecycle_config: object_tags: 10000000 # Total object tags. standard: # Usages of S3 Standard: - storage_gb: 10000 # Total storage in GB. - monthly_tier_1_requests: 1000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 100000 # Monthly GET, SELECT, and all other requests (Tier 2). + storage_gb: 10000 # Total storage in GB. + monthly_tier_1_requests: 1000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 100000 # Monthly GET, SELECT, and all other requests (Tier 2). monthly_select_data_scanned_gb: 10000 # Monthly data scanned by S3 Select in GB. monthly_select_data_returned_gb: 1000 # Monthly data returned by S3 Select in GB. intelligent_tiering: # Usages of S3 Intelligent - Tiering: - frequent_access_storage_gb: 20000 # Total storage for Frequent Access Tier in GB. - infrequent_access_storage_gb: 20000 # Total storage for Infrequent Access Tier in GB. - monitored_objects: 2000 # Total objects monitored by the Intelligent Tiering. - monthly_tier_1_requests: 2000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 200000 # Monthly GET, SELECT, and all other requests (Tier 2). + frequent_access_storage_gb: 20000 # Total storage for Frequent Access Tier in GB. + infrequent_access_storage_gb: 20000 # Total storage for Infrequent Access Tier in GB. + monitored_objects: 2000 # Total objects monitored by the Intelligent Tiering. + monthly_tier_1_requests: 2000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 200000 # Monthly GET, SELECT, and all other requests (Tier 2). monthly_lifecycle_transition_requests: 200000 # Monthly Lifecycle Transition requests. - monthly_select_data_scanned_gb: 20000 # Monthly data scanned by S3 Select in GB. - monthly_select_data_returned_gb: 2000 # Monthly data returned by S3 Select in GB. - early_delete_gb: 200000 # If an archive is deleted within 1 months of being uploaded, you will be charged an early deletion fee per GB. + monthly_select_data_scanned_gb: 20000 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 2000 # Monthly data returned by S3 Select in GB. + early_delete_gb: 200000 # If an archive is deleted within 1 months of being uploaded, you will be charged an early deletion fee per GB. standard_infrequent_access: # Usages of S3 Standard - Infrequent Access: - storage_gb: 30000 # Total storage in GB. - monthly_tier_1_requests: 3000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 300000 # Monthly GET, SELECT, and all other requests (Tier 2). + storage_gb: 30000 # Total storage in GB. + monthly_tier_1_requests: 3000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 300000 # Monthly GET, SELECT, and all other requests (Tier 2). monthly_lifecycle_transition_requests: 300000 # Monthly Lifecycle Transition requests. - monthly_data_retrieval_gb: 30000 # Monthly data retrievals in GB - monthly_select_data_scanned_gb: 30000 # Monthly data scanned by S3 Select in GB. - monthly_select_data_returned_gb: 3000 # Monthly data returned by S3 Select in GB. + monthly_data_retrieval_gb: 30000 # Monthly data retrievals in GB + monthly_select_data_scanned_gb: 30000 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 3000 # Monthly data returned by S3 Select in GB. one_zone_infrequent_access: # Usages of S3 One Zone - Infrequent Access: - storage_gb: 40000 # Total storage in GB. - monthly_tier_1_requests: 4000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 400000 # Monthly GET, SELECT, and all other requests (Tier 2). + storage_gb: 40000 # Total storage in GB. + monthly_tier_1_requests: 4000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 400000 # Monthly GET, SELECT, and all other requests (Tier 2). monthly_lifecycle_transition_requests: 400000 # Monthly Lifecycle Transition requests. - monthly_data_retrieval_gb: 40000 # Monthly data retrievals in GB - monthly_select_data_scanned_gb: 40000 # Monthly data scanned by S3 Select in GB. - monthly_select_data_returned_gb: 4000 # Monthly data returned by S3 Select in GB. + monthly_data_retrieval_gb: 40000 # Monthly data retrievals in GB + monthly_select_data_scanned_gb: 40000 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 4000 # Monthly data returned by S3 Select in GB. glacier_flexible_retrieval: # Usages of S3 Glacier Flexible Retrieval: - storage_gb: 50000 # Total storage in GB. - monthly_tier_1_requests: 5000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 500000 # Monthly GET, SELECT, and all other requests (Tier 2). - monthly_lifecycle_transition_requests: 500000 # Monthly Lifecycle Transition requests. - monthly_standard_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for standard level of S3 Glacier). - monthly_standard_select_data_returned_gb: 500000 # Monthly data returned by S3 Select in GB (for standard level of S3 Glacier). - monthly_bulk_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for bulk level of S3 Glacier) - monthly_bulk_select_data_returned_gb: 500000 # Monthly data returned by S3 Select in GB (for bulk level of S3 Glacier) - monthly_expedited_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for expedited level of S3 Glacier) + storage_gb: 50000 # Total storage in GB. + monthly_tier_1_requests: 5000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 500000 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 500000 # Monthly Lifecycle Transition requests. + monthly_standard_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for standard level of S3 Glacier). + monthly_standard_select_data_returned_gb: 500000 # Monthly data returned by S3 Select in GB (for standard level of S3 Glacier). + monthly_bulk_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for bulk level of S3 Glacier) + monthly_bulk_select_data_returned_gb: 500000 # Monthly data returned by S3 Select in GB (for bulk level of S3 Glacier) + monthly_expedited_select_data_scanned_gb: 500000 # Monthly data scanned by S3 Select in GB (for expedited level of S3 Glacier) monthly_expedited_select_data_returned_gb: 500000 # Monthly data returned by S3 Select in GB (for expedited level of S3 Glacier) - monthly_standard_data_retrieval_requests: 500000 # Monthly data Retrieval requests (for standard level of S3 Glacier). + monthly_standard_data_retrieval_requests: 500000 # Monthly data Retrieval requests (for standard level of S3 Glacier). monthly_expedited_data_retrieval_requests: 500000 # Monthly data Retrieval requests (for expedited level of S3 Glacier). - monthly_standard_data_retrieval_gb: 5000 # Monthly data retrievals in GB (for standard level of S3 Glacier). - monthly_expedited_data_retrieval_gb: 5000 # Monthly data retrievals in GB (for expedited level of S3 Glacier). - early_delete_gb: 500000 # If an archive is deleted within 3 months of being uploaded, you will be charged an early deletion fee per GB. + monthly_standard_data_retrieval_gb: 5000 # Monthly data retrievals in GB (for standard level of S3 Glacier). + monthly_expedited_data_retrieval_gb: 5000 # Monthly data retrievals in GB (for expedited level of S3 Glacier). + early_delete_gb: 500000 # If an archive is deleted within 3 months of being uploaded, you will be charged an early deletion fee per GB. glacier_deep_archive: # Usages of S3 Glacier Deep Archive: - storage_gb: 60000 # Total storage in GB. - monthly_tier_1_requests: 6000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). - monthly_tier_2_requests: 600000 # Monthly GET, SELECT, and all other requests (Tier 2). - monthly_lifecycle_transition_requests: 600000 # Monthly Lifecycle Transition requests. + storage_gb: 60000 # Total storage in GB. + monthly_tier_1_requests: 6000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 600000 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 600000 # Monthly Lifecycle Transition requests. monthly_standard_data_retrieval_requests: 600000 # Monthly data Retrieval requests (for standard level of S3 Glacier). - monthly_bulk_data_retrieval_requests: 600000 # Monthly data Retrieval requests (for bulk level of S3 Glacier). - monthly_standard_data_retrieval_gb: 6000 # Monthly data retrievals in GB (for standard level of S3 Glacier). - monthly_bulk_data_retrieval_gb: 6000 # Monthly data retrievals in GB (for bulk level of S3 Glacier). - early_delete_gb: 600000 # If an archive is deleted within 6 months of being uploaded, you will be charged an early deletion fee per GB. + monthly_bulk_data_retrieval_requests: 600000 # Monthly data Retrieval requests (for bulk level of S3 Glacier). + monthly_standard_data_retrieval_gb: 6000 # Monthly data retrievals in GB (for standard level of S3 Glacier). + monthly_bulk_data_retrieval_gb: 6000 # Monthly data retrievals in GB (for bulk level of S3 Glacier). + early_delete_gb: 600000 # If an archive is deleted within 6 months of being uploaded, you will be charged an early deletion fee per GB. aws_s3_bucket.my_bucket: object_tags: 10000000 # Total object tags. Only for AWS provider V3. @@ -590,20 +601,20 @@ resource_usage: aws_sns_topic_subscription.my_topic_subscription: monthly_requests: 1000000 # (DEPRECATED use aws_sns_topic.monthly_requests instead) Monthly requests to SNS. - request_size_kb: 64 # (DEPRECATED use aws_sns_topic.request_size_kb instead) Size of requests to SNS, billed in 64KB chunks. So 1M requests at 128KB uses 2M requests. + request_size_kb: 64 # (DEPRECATED use aws_sns_topic.request_size_kb instead) Size of requests to SNS, billed in 64KB chunks. So 1M requests at 128KB uses 2M requests. aws_sqs_queue.my_queue: monthly_requests: 1000000 # Monthly requests to SQS. - request_size_kb: 64 # Size of requests to SQS, billed in 64KB chunks. So 1M requests at 128KB uses 2M requests. + request_size_kb: 64 # Size of requests to SQS, billed in 64KB chunks. So 1M requests at 128KB uses 2M requests. aws_ssm_parameter.my_ssm_parameter: - api_throughput_limit: standard # SSM Parameter Throughput limit, can be: standard, advanced, higher. + api_throughput_limit: standard # SSM Parameter Throughput limit, can be: standard, advanced, higher. monthly_api_interactions: 1000000 # Monthly API interactions. - parameter_storage_hrs: 730 # Number of hours in the month parameters will be stored for. + parameter_storage_hrs: 730 # Number of hours in the month parameters will be stored for. aws_ssm_activation.my_activations: instance_tier: standard # Instance tier being used, can be: standard, advanced. - instances: 100 # Number of instances being managed. + instances: 100 # Number of instances being managed. aws_transfer_server.my_transfer_server: monthly_data_downloaded_gb: 50 # Monthly data downloaded over enabled protocols in GB. @@ -617,59 +628,59 @@ resource_usage: aws_cloudfront_distribution.my_s3_distribution: monthly_data_transfer_to_internet_gb: # Monthly regional data transfer out to internet from the following, in GB: - us: 51200000 # United States, Mexico, Canada - europe: 220000 # Europe, Israel - south_africa: 10000 # South Africa, Kenya, Middle East - south_america: 50000 # South America - japan: 387000 # Japan - australia: 500000 # Australia, New Zealand + us: 51200000 # United States, Mexico, Canada + europe: 220000 # Europe, Israel + south_africa: 10000 # South Africa, Kenya, Middle East + south_america: 50000 # South America + japan: 387000 # Japan + australia: 500000 # Australia, New Zealand asia_pacific: 1200000 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand - india: 200000 # India + india: 200000 # India monthly_data_transfer_to_origin_gb: # Monthly regional data transfer out to origin from the following, in GB: - us: 2200 # United States, Mexico, Canada - europe: 1000 # Europe, Israel - south_africa: 300 # South Africa, Kenya, Middle East + us: 2200 # United States, Mexico, Canada + europe: 1000 # Europe, Israel + south_africa: 300 # South Africa, Kenya, Middle East south_america: 200 # South America - japan: 10 # Japan - australia: 100 # Australia, New Zealand - asia_pacific: 30 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand - india: 80 # India + japan: 10 # Japan + australia: 100 # Australia, New Zealand + asia_pacific: 30 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 80 # India monthly_http_requests: # Monthly number of HTTP requests to: - us: 80000 # United States, Mexico, Canada - europe: 40000 # Europe, Israel - south_africa: 20000 # South Africa, Kenya, Middle East + us: 80000 # United States, Mexico, Canada + europe: 40000 # Europe, Israel + south_africa: 20000 # South Africa, Kenya, Middle East south_america: 10000 # South America - japan: 3000 # Japan - australia: 15000 # Australia, New Zealand - asia_pacific: 45000 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand - india: 10000 # India + japan: 3000 # Japan + australia: 15000 # Australia, New Zealand + asia_pacific: 45000 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 10000 # India monthly_https_requests: # Monthly number of HTTPS requests to: - us: 180000 # United States, Mexico, Canada - europe: 10000 # Europe, Israel - south_africa: 50000 # South Africa, Kenya, Middle East + us: 180000 # United States, Mexico, Canada + europe: 10000 # Europe, Israel + south_africa: 50000 # South Africa, Kenya, Middle East south_america: 30000 # South America - japan: 1000 # Japan - australia: 45000 # Australia, New Zealand - asia_pacific: 25000 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand - india: 30000 # India + japan: 1000 # Japan + australia: 45000 # Australia, New Zealand + asia_pacific: 25000 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 30000 # India monthly_shield_requests: # Monthly number of shield requests to: - us: 90000 # United States - europe: 30000 # Europe + us: 90000 # United States + europe: 30000 # Europe south_america: 200 # South America - japan: 12300 # Japan - australia: 2300 # Australia - singapore: 58600 # Singapore + japan: 12300 # Japan + australia: 2300 # Australia + singapore: 58600 # Singapore south_korea: 24000 # South Korea - india: 10000 # India + india: 10000 # India monthly_invalidation_requests: 1200 # Monthly number of invalidation requests. monthly_encryption_requests: 100000 # Monthly number of field level encryption requests. - monthly_log_lines: 5000000 # Monthly number of real-time log lines. - custom_ssl_certificates: 3 # Number of dedicated IP custom SSL certificates. + monthly_log_lines: 5000000 # Monthly number of real-time log lines. + custom_ssl_certificates: 3 # Number of dedicated IP custom SSL certificates. aws_sfn_state_machine.my_sfn_state_machine: monthly_transitions: 1000 # Monthly number of state transitions. Only applicable for Standard Workflows. - monthly_requests: 10000 # Monthly number of workflow requests. Only applicable for Express Workflows. - memory_mb: 128 # Average amount of memory consumed by workflow in MB. Only applicable for Express Workflows. + monthly_requests: 10000 # Monthly number of workflow requests. Only applicable for Express Workflows. + memory_mb: 128 # Average amount of memory consumed by workflow in MB. Only applicable for Express Workflows. workflow_duration_ms: 500 # Average duration of workflow in milliseconds. Only applicable for Express Workflows. aws_waf_web_acl.my_waf: @@ -677,7 +688,7 @@ resource_usage: monthly_requests: 1000000 # Monthly number of web requests received. aws_wafv2_web_acl.my_waf2: - rule_group_rules: 5 # Total number of Rule Group rules used by the Web ACL. + rule_group_rules: 5 # Total number of Rule Group rules used by the Web ACL. managed_rule_group_rules: 10 # Total number of Managed Rule Group rules used by the Web ACL. monthly_requests: 1000000 # Monthly number of web requests received. @@ -694,69 +705,69 @@ resource_usage: monthly_queries_tb: 100 # Monthly number of bytes processed (also referred to as bytes read) in TB. google_bigquery_table.usage: - monthly_active_storage_gb: 1000 # Monthly number of active storage modifications in GB. + monthly_active_storage_gb: 1000 # Monthly number of active storage modifications in GB. monthly_long_term_storage_gb: 1000 # Monthly number of long-term storage modifications in GB. monthly_streaming_inserts_mb: 1000 # Monthly number of streaming data inserts in MB. monthly_storage_write_api_gb: 1000 # Monthly number of storage write api in GB. - monthly_storage_read_api_tb: 1000 # Monthly number of storage read api in TB. + monthly_storage_read_api_tb: 1000 # Monthly number of storage read api in TB. google_cloudfunctions_function.my_function: - request_duration_ms: 300 # Average duration of each request in milliseconds. + request_duration_ms: 300 # Average duration of each request in milliseconds. monthly_function_invocations: 10000000 # Monthly number of function invocations. - monthly_outbound_data_gb: 100 # Monthly data transferred from the function out to somewhere else in GB. + monthly_outbound_data_gb: 100 # Monthly data transferred from the function out to somewhere else in GB. google_compute_router_nat.my_nat: - assigned_vms: 4 # Number of VM instances assigned to the NAT gateway + assigned_vms: 4 # Number of VM instances assigned to the NAT gateway monthly_data_processed_gb: 1000 # Monthly data processed (ingress and egress) by the NAT gateway in GB google_container_cluster.my_cluster: - autopilot_vcpu_count: 10 # Number of vCPUs used by Autopilot pods. Only relevant for Autopilot mode. - autopilot_memory_gb: 50 # Total memory used by Autopilot pods. Only relevant for Autopilot mode. + autopilot_vcpu_count: 10 # Number of vCPUs used by Autopilot pods. Only relevant for Autopilot mode. + autopilot_memory_gb: 50 # Total memory used by Autopilot pods. Only relevant for Autopilot mode. autopilot_ephemeral_storage_gb: 100 # Total ephemeral storage used by Autopilot pods. Only relevant for Autopilot mode. - nodes: 4 # Node count per zone for the default node pool. Only relevant for Standard mode. + nodes: 4 # Node count per zone for the default node pool. Only relevant for Standard mode. node_pool[0]: - nodes: 2 # Node count per zone for the first node pool. Only relevant for Standard mode. + nodes: 2 # Node count per zone for the first node pool. Only relevant for Standard mode. google_container_node_pool.my_node_pool: nodes: 4 # Node count per zone for the node pool google_container_registry.my_registry: - storage_gb: 150 # Total size of bucket in GB. + storage_gb: 150 # Total size of bucket in GB. monthly_class_a_operations: 40000 # Monthly number of class A operations (object adds, bucket/object list). monthly_class_b_operations: 20000 # Monthly number of class B operations (object gets, retrieve bucket/object metadata). - monthly_data_retrieval_gb: 500 # Monthly amount of data retrieved in GB. - monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: - same_continent: 550 # Same continent. - worldwide: 12500 # Worldwide excluding Asia, Australia. - asia: 1500 # Asia excluding China, but including Hong Kong. - china: 50 # China excluding Hong Kong. - australia: 250 # Australia. + monthly_data_retrieval_gb: 500 # Monthly amount of data retrieved in GB. + monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: + same_continent: 550 # Same continent. + worldwide: 12500 # Worldwide excluding Asia, Australia. + asia: 1500 # Asia excluding China, but including Hong Kong. + china: 50 # China excluding Hong Kong. + australia: 250 # Australia. google_compute_external_vpn_gateway.my_compute_external_vpn_gateway: - monthly_egress_data_transfer_gb: # Monthly data transfer from VPN gateway to the following, in GB: - worldwide: 12500 # Worldwide excluding China, Australia but including Hong Kong. - china: 8500 # China excluding Hong Kong. - australia: 250 # Australia. + monthly_egress_data_transfer_gb: # Monthly data transfer from VPN gateway to the following, in GB: + worldwide: 12500 # Worldwide excluding China, Australia but including Hong Kong. + china: 8500 # China excluding Hong Kong. + australia: 250 # Australia. google_compute_vpn_gateway.my_compute_vpn_gateway: - monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: - same_region: 250 # VMs in the same Google Cloud region. - us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. - europe: 70 # Between Google Cloud regions within Europe. - asia: 50 # Between Google Cloud regions within Asia. - south_america: 100 # Between Google Cloud regions within South America. - oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. - worldwide: 200 # to a Google Cloud region on another continent. + monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: + same_region: 250 # VMs in the same Google Cloud region. + us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 70 # Between Google Cloud regions within Europe. + asia: 50 # Between Google Cloud regions within Asia. + south_america: 100 # Between Google Cloud regions within South America. + oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 200 # to a Google Cloud region on another continent. google_compute_ha_vpn_gateway.my_compute_ha_vpn_gateway: - monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: - same_region: 250 # VMs in the same Google Cloud region. - us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. - europe: 70 # Between Google Cloud regions within Europe. - asia: 50 # Between Google Cloud regions within Asia. - south_america: 100 # Between Google Cloud regions within South America. - oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. - worldwide: 200 # to a Google Cloud region on another continent. + monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: + same_region: 250 # VMs in the same Google Cloud region. + us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 70 # Between Google Cloud regions within Europe. + asia: 50 # Between Google Cloud regions within Asia. + south_america: 100 # Between Google Cloud regions within South America. + oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 200 # to a Google Cloud region on another continent. google_compute_forwarding_rule.my_forwarding: monthly_ingress_data_gb: 100 @@ -805,51 +816,51 @@ resource_usage: monthly_data_processed_gb: 100 google_dns_record_set.my_record_set: - monthly_queries: 1000000 # Monthly DNS queries. + monthly_queries: 1000000 # Monthly DNS queries. google_kms_crypto_key.my_keys: - key_versions: 10000 # Number of key versions. + key_versions: 10000 # Number of key versions. monthly_key_operations: 1000000 # Monthly number of key operations. google_logging_billing_account_bucket_config.my_config: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_billing_account_sink.my_sink: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_folder_bucket_config.my_config: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_folder_sink.my_sink: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_organization_bucket_config.my.config: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_organization_sink.my_sink: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_project_bucket_config.my_config: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_logging_project_sink.my_sink: - monthly_logging_data_gb: 100 # Monthly logging data in GB. + monthly_logging_data_gb: 100 # Monthly logging data in GB. google_monitoring_metric_descriptor.my_monitoring: monthly_monitoring_data_mb: 5000 # Monthly monitoring data in MB (only for chargeable metrics). - monthly_api_calls: 1000000 # Monthly read API calls (write calls are free). + monthly_api_calls: 1000000 # Monthly read API calls (write calls are free). google_pubsub_subscription.my_subscription: monthly_message_data_tb: 7.416 # Monthly amount of message data pulled by the subscription in TB. - storage_gb: 605 # Storage for retaining acknowledged messages in GB. - snapshot_storage_gb: 70.6 # Snapshot storage for unacknowledged messages in GB. + storage_gb: 605 # Storage for retaining acknowledged messages in GB. + snapshot_storage_gb: 70.6 # Snapshot storage for unacknowledged messages in GB. google_pubsub_topic.my_topic: monthly_message_data_tb: 7.416 # Monthly amount of message data published to the topic in TB. google_secret_manager_secret.my_secret: - active_secret_versions: 10000 # Number of active secret versions in each month. NOTE: this is used only when secret versions are not defined. - monthly_access_operations: 20000 # Monthly number of access operations + active_secret_versions: 10000 # Number of active secret versions in each month. NOTE: this is used only when secret versions are not defined. + monthly_access_operations: 20000 # Monthly number of access operations monthly_rotation_notifications: 100 # Monthly number of rotation notifications google_secret_manager_secret_version.my_secret_version: @@ -857,28 +868,28 @@ resource_usage: google_service_networking_connection.my_connection: monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: - same_region: 250 # VMs in the same Google Cloud region. - us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. - europe: 70 # Between Google Cloud regions within Europe. - asia: 50 # Between Google Cloud regions within Asia. - south_america: 100 # Between Google Cloud regions within South America. - oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. - worldwide: 200 # to a Google Cloud region on another continent. + same_region: 250 # VMs in the same Google Cloud region. + us_or_canada: 100 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 70 # Between Google Cloud regions within Europe. + asia: 50 # Between Google Cloud regions within Asia. + south_america: 100 # Between Google Cloud regions within South America. + oceania: 50 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 200 # to a Google Cloud region on another continent. google_sql_database_instance.my_instance: backup_storage_gb: 1000 # Amount of backup storage in GB. google_storage_bucket.my_storage_bucket: - storage_gb: 150 # Total size of bucket in GB. + storage_gb: 150 # Total size of bucket in GB. monthly_class_a_operations: 40000 # Monthly number of class A operations (object adds, bucket/object list). monthly_class_b_operations: 20000 # Monthly number of class B operations (object gets, retrieve bucket/object metadata). - monthly_data_retrieval_gb: 500 # Monthly amount of data retrieved in GB. - monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: - same_continent: 550 # Same continent. - worldwide: 12500 # Worldwide excluding Asia, Australia. - asia: 1500 # Asia excluding China, but including Hong Kong. - china: 50 # China excluding Hong Kong. - australia: 250 # Australia. + monthly_data_retrieval_gb: 500 # Monthly amount of data retrieved in GB. + monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: + same_continent: 550 # Same continent. + worldwide: 12500 # Worldwide excluding Asia, Australia. + asia: 1500 # Asia excluding China, but including Hong Kong. + china: 50 # China excluding Hong Kong. + australia: 250 # Australia. # # Terraform AzureRM resources @@ -888,7 +899,7 @@ resource_usage: self_hosted_gateway_count: 5 # Number of self-hosted gateways (only for premium tier). azurerm_app_service_environment.my_service: - operating_system: linux # Override the operating system of the instance, can be: linux, windows. + operating_system: linux # Override the operating system of the instance, can be: linux, windows. azurerm_application_insights.my_insights: monthly_data_ingested_gb: 1000 # Monthly amount of data ingested in GB. @@ -906,7 +917,7 @@ resource_usage: azurerm_application_gateway.my_gateway: monthly_data_processed_gb: 100000 # Monthly data processed by the Application Gateway in GB. - monthly_v2_capacity_units: 10000 # Number capacity(for v2) units gateway. + monthly_v2_capacity_units: 10000 # Number capacity(for v2) units gateway. azurerm_automation_job_schedule.my_schedule: monthly_job_run_mins: 0 # Monthly number of job run minutes. @@ -922,8 +933,8 @@ resource_usage: azurerm_function_app.my_functions: monthly_executions: 100000 # Monthly executions to the function. Only applicable for Consumption plan. execution_duration_ms: 500 # Average duration of each execution in milliseconds. Only applicable for Consumption plan. - memory_mb: 128 # Average amount of memory consumed by function in MB. Only applicable for Consumption plan. - instances: 1 # Number of instances. Only applicable for Premium plan. + memory_mb: 128 # Average amount of memory consumed by function in MB. Only applicable for Consumption plan. + instances: 1 # Number of instances. Only applicable for Premium plan. azurerm_cdn_endpoint.my_endpoint: monthly_outbound_gb: 1000000 # Monthly number of outbound data transfers in GB. @@ -1003,7 +1014,7 @@ resource_usage: azurerm_data_factory.my_data_factory: monthly_read_write_operation_entities: 100000 # Monthly entities for Read/Write operations. - monthly_monitoring_operation_entities: 25000 # Monthly entities for Monitoring operations. + monthly_monitoring_operation_entities: 25000 # Monthly entities for Monitoring operations. azurerm_data_factory_integration_runtime_azure.my_runtime: monthly_orchestration_runs: 10000 # Monthly Orchestration runs for runtime. @@ -1015,56 +1026,56 @@ resource_usage: monthly_orchestration_runs: 10000 # Monthly Orchestration runs for runtime. azurerm_dns_a_record.my_a_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_aaaa_record.my_aaaa_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_caa_record.my_caa_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_cname_record.my_cname_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_mx_record.my_mx_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_ns_record.my_ns_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_ptr_record.my_ptr_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_srv_record.my_srv_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_dns_txt_record.my_txt_record: - monthly_queries: 11500000000 # Monthly number of DNS queries + monthly_queries: 11500000000 # Monthly number of DNS queries azurerm_eventhub_namespace.my_event_hub: monthly_ingress_events: 100000000 # Monthly number of ingress events, only applicable for Basic and Standard namespaces. - retention_storage_gb: 10000 # Total data stored for retention in GB, used to calculate Extended Retention costs, only applicable for Dedicated namespaces. - throughput_or_capacity_units: 10 # Number of Throughput Units (for Basic and Standard) and Capacity units (for Dedicated) namespaces. - capture_enabled: false # Defines if capture is enabled for the Event Hub Standard namespaces, can be: true, false. + retention_storage_gb: 10000 # Total data stored for retention in GB, used to calculate Extended Retention costs, only applicable for Dedicated namespaces. + throughput_or_capacity_units: 10 # Number of Throughput Units (for Basic and Standard) and Capacity units (for Dedicated) namespaces. + capture_enabled: false # Defines if capture is enabled for the Event Hub Standard namespaces, can be: true, false. azurerm_frontdoor.my_frontdoor: monthly_outbound_data_transfer_gb: # Monthly outbound data transfer from the following, in GB: - us_gov: 190000 # US Gov - north_america_europe_africa: 200000 # North America, Europe and Africa - asia_pacific: 220000 # Asia Pacific (including Japan) - south_america: 10000 # South America - australia: 50000 # Australia - india: 387000 # India + us_gov: 190000 # US Gov + north_america_europe_africa: 200000 # North America, Europe and Africa + asia_pacific: 220000 # Asia Pacific (including Japan) + south_america: 10000 # South America + australia: 50000 # Australia + india: 387000 # India monthly_inbound_data_transfer_gb: 1000 # Monthly inbound data transfer in GB azurerm_log_analytics_workspace.my_workspace: - monthly_log_data_ingestion_gb: 20 # Monthly log data ingested by the workspace in GB (only used for Pay-as-you-go workspaces). + monthly_log_data_ingestion_gb: 20 # Monthly log data ingested by the workspace in GB (only used for Pay-as-you-go workspaces). monthly_additional_log_data_retention_gb: 30 # Monthly additional GB of data retained past the free allowance. - monthly_log_data_export_gb: 40 # Monthly data in GB exported from the workspace. - monthly_sentinel_data_ingestion_gb: 40 # Monthly data in GB exported from Microsoft Sentinel, this only applies when it is enabled. + monthly_log_data_export_gb: 40 # Monthly data in GB exported from the workspace. + monthly_sentinel_data_ingestion_gb: 40 # Monthly data in GB exported from Microsoft Sentinel, this only applies when it is enabled. azurerm_frontdoor_firewall_policy.my_frontdoor_firewall_policy: - monthly_custom_rule_requests: 11000 # Monthly number of custom rule requests + monthly_custom_rule_requests: 11000 # Monthly number of custom rule requests monthly_managed_ruleset_requests: 10000 # Monthly number of managed ruleset requests azurerm_kubernetes_cluster.my_cluster: @@ -1096,14 +1107,14 @@ resource_usage: monthly_disk_operations: 2000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB. azurerm_key_vault_certificate.my_certificate: - monthly_certificate_renewal_requests: 100 # Monthly number of certificate renewal requests. + monthly_certificate_renewal_requests: 100 # Monthly number of certificate renewal requests. monthly_certificate_other_operations: 100000 # Monthly number of non-renewal certificate operations. azurerm_key_vault_key.my_keys: - monthly_secrets_operations: 10000 # Monthly number of secrets transactions. - monthly_key_rotation_renewals: 50 # Monthly number of Managed Azure Storage account key rotation renewals. + monthly_secrets_operations: 10000 # Monthly number of secrets transactions. + monthly_key_rotation_renewals: 50 # Monthly number of Managed Azure Storage account key rotation renewals. monthly_protected_keys_operations: 1000000 # Monthly number of Software or HSM transactions. - hsm_protected_keys: 3000 # Number of protected keys. + hsm_protected_keys: 3000 # Number of protected keys. azurerm_linux_virtual_machine_scale_set.standard_f2: instances: 10 # Override the number of instances in the scale set. @@ -1120,9 +1131,9 @@ resource_usage: additional_backup_storage_gb: 2000 # Additional consumption of backup storage in GB. azurerm_mssql_database.my_database: - monthly_vcore_hours: 600 # Monthly number of used vCore-hours for serverless compute. + monthly_vcore_hours: 600 # Monthly number of used vCore-hours for serverless compute. long_term_retention_storage_gb: 1000 # Number of GBs used by long-term retention backup storage. - extra_data_storage_gb: 250 # Override number of GBs used by extra data storage. + extra_data_storage_gb: 250 # Override number of GBs used by extra data storage. azurerm_mysql_flexible_server.my_flexible_server: additional_backup_storage_gb: 5000 # Additional backup storage in GB. If geo-redundancy is enabled, you should set this to twice the required storage capacity. @@ -1146,25 +1157,25 @@ resource_usage: additional_backup_storage_gb: 3000 # Additional consumption of backup storage in GB. azurerm_private_dns_a_record.my_a_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_aaaa_record.my_aaaa_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_cname_record.my_cname_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_mx_record.my_mx_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_ptr_record.my_ptr_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_srv_record.my_srv_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_dns_txt_record.my_txt_record: - monthly_queries: 1500000000 # Monthly number of DNS queries + monthly_queries: 1500000000 # Monthly number of DNS queries azurerm_private_endpoint.with_inbound: monthly_inbound_data_processed_gb: 100 # Monthly inbound data processed in GB. @@ -1174,28 +1185,28 @@ resource_usage: monthly_images_extracted: 1000000 # Monthly number of extracted images azurerm_storage_account.my_account: - data_at_rest_storage_gb: 10000 # Total size of Data at Rest in GB (File storage). - early_deletion_gb: 1000 # Total size of Early deletion data in GB. - snapshots_storage_gb: 10000 # Total size of Snapshots in GB (File storage). - metadata_at_rest_storage_gb: 10000 # Total size of Metadata in GB (File storage). - storage_gb: 1000000 # Total size of storage in GB. - monthly_iterative_write_operations: 170000 # Monthly number of Iterative write operations (GPv2). - monthly_write_operations: 1000000 # Monthly number of Write operations. + data_at_rest_storage_gb: 10000 # Total size of Data at Rest in GB (File storage). + early_deletion_gb: 1000 # Total size of Early deletion data in GB. + snapshots_storage_gb: 10000 # Total size of Snapshots in GB (File storage). + metadata_at_rest_storage_gb: 10000 # Total size of Metadata in GB (File storage). + storage_gb: 1000000 # Total size of storage in GB. + monthly_iterative_write_operations: 170000 # Monthly number of Iterative write operations (GPv2). + monthly_write_operations: 1000000 # Monthly number of Write operations. monthly_list_and_create_container_operations: 1000000 # Monthly number of List and Create Container operations. - monthly_iterative_read_operations: 150000 # Monthly number of Iterative read operations (GPv2). - monthly_read_operations: 100000 # Monthly number of Read operations. - monthly_other_operations: 1000000 # Monthly number of All other operations. - monthly_data_retrieval_gb: 1000 # Monthly number of data retrieval in GB. - monthly_data_write_gb: 1000 # Monthly number of data write in GB. - blob_index_tags: 100000 # Total number of Blob indexes. + monthly_iterative_read_operations: 150000 # Monthly number of Iterative read operations (GPv2). + monthly_read_operations: 100000 # Monthly number of Read operations. + monthly_other_operations: 1000000 # Monthly number of All other operations. + monthly_data_retrieval_gb: 1000 # Monthly number of data retrieval in GB. + monthly_data_write_gb: 1000 # Monthly number of data write in GB. + blob_index_tags: 100000 # Total number of Blob indexes. azurerm_sql_database.my_database: - monthly_vcore_hours: 600 # Monthly number of used vCore-hours for serverless compute. + monthly_vcore_hours: 600 # Monthly number of used vCore-hours for serverless compute. long_term_retention_storage_gb: 1000 # Number of GBs used by long-term retention backup storage. - extra_data_storage_gb: 250 # Override number of GBs used by extra data storage. - + extra_data_storage_gb: 250 # Override number of GBs used by extra data storage. + azurerm_sql_managed_instance.my_database: - backup_storage_gb: 100 # Backup storage size dedicated for Point In Time Restoration + backup_storage_gb: 100 # Backup storage size dedicated for Point In Time Restoration long_term_retention_storage_gb: 5 # Number of GBs used by long-term retention backup storage. azurerm_synapse_spark_pool.my_spark_pool: @@ -1301,7 +1312,7 @@ resource_usage: ibm_is_lb.lb: monthly_instance_hours: 730 # Monthly number of hours an instance runs - gigabyte_processed: 1000 # Monthly gigabytes of data processed by the load balancer + gigabyte_processed: 1000 # Monthly gigabytes of data processed by the load balancer ibm_is_instance.is_instance: monthly_instance_hours: 730 # Monthly number of hours an instance runs @@ -1328,7 +1339,7 @@ resource_usage: ibm_pi_volume.pi_volume: monthly_instance_hours: 730 # Monthly number of instance hours - ibm_resource_instance.resource_instance_kms: + ibm_resource_instance.resource_instance_kms: kms_key_versions: 6 # Number of key versions managed per month secretsmanager_active_secrets: 1 # Number of active secrets secretsmanager_instance: 1 # Number of instances of secrets manager @@ -1340,7 +1351,7 @@ resource_usage: appconnect_vcpu_hours: 10 # The number of VCPU hours used in a month logdna_gigabyte_months: 10 # The amount of logs in a month in GB activitytracker_gigabyte_months: 10 # The amount of logs in a month in GB - sysdig-monitor_NODE_HOURS: 700 # The amount of hours monitoring runs on a host in a month + sysdig-monitor_NODE_HOURS: 700 # The amount of hours monitoring runs on a host in a month sysdig-monitor_CONTAINER_HOURS: 700 # Additional containers on a host above the base 50 sysdig-monitor_API_CALL_HOURS: 1000 # Additional API calls above the base 1M/instance sysdig-monitor_TIME_SERIES_HOURS: 1000 # Additional time-series cost above the base 1000/host @@ -1374,7 +1385,7 @@ resource_usage: 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 @@ -1388,6 +1399,19 @@ resource_usage: messagehub_qty_terabytes: 1 messagehub_GIGABYTE_TRANSMITTED_OUTBOUNDS: 1 + ibm_resource_instance.event_notifications: + event-notifications_MILLION_INGESTED_EVENTS: 1 + + ibm_en_subscription_android.subscription_android: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + + # event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL: 1 + # event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL: 0 + # event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS: 0 + # event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 0 + # event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS: 0 + # event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY: 1 + # event-notifications_RESOURCE_UNITS_NUMBER_SETUP: 1 ibm_tg_gateway.tg_gateway: connection: 25 # Monthly number of connections to the gateway @@ -1396,7 +1420,7 @@ resource_usage: ibm_is_share.nfs: is-share_monthly_instance_hours: 730 # Monthly number of instance hours - is-share_monthly_transmitted_gb: 1 # Data transmitted between two file shares for replication + is-share_monthly_transmitted_gb: 1 # Data transmitted between two file shares for replication ibm_is_vpc_server: is.vpn-server_CONNECTION_HOURS: 730 diff --git a/internal/providers/terraform/ibm/en_destination.go b/internal/providers/terraform/ibm/en_destination.go new file mode 100644 index 00000000000..c061d57c62d --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_android", + RFunc: newEnDestination, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestination(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + var plan string + + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestination{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_chrome.go b/internal/providers/terraform/ibm/en_destination_chrome.go new file mode 100644 index 00000000000..7b0d0ab9e55 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_chrome.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationChromeRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_chrome", + RFunc: newEnDestinationChrome, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestinationChrome(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestinationChrome{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_chrome_test.go b/internal/providers/terraform/ibm/en_destination_chrome_test.go new file mode 100644 index 00000000000..5bc1406bceb --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_chrome_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestinationChrome(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_chrome_test") +} diff --git a/internal/providers/terraform/ibm/en_destination_firefox.go b/internal/providers/terraform/ibm/en_destination_firefox.go new file mode 100644 index 00000000000..ed780149548 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_firefox.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationFirefoxRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_firefox", + RFunc: newEnDestinationFirefox, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestinationFirefox(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestinationFirefox{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_firefox_test.go b/internal/providers/terraform/ibm/en_destination_firefox_test.go new file mode 100644 index 00000000000..f06edd8eacc --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_firefox_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestinationFirefox(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_firefox_test") +} diff --git a/internal/providers/terraform/ibm/en_destination_huawei.go b/internal/providers/terraform/ibm/en_destination_huawei.go new file mode 100644 index 00000000000..4e1f0612d98 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_huawei.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationHuaweiRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_huawei", + RFunc: newEnDestinationHuawei, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestinationHuawei(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestinationHuawei{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_huawei_test.go b/internal/providers/terraform/ibm/en_destination_huawei_test.go new file mode 100644 index 00000000000..2326846408d --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_huawei_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestinationHuawei(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_huawei_test") +} diff --git a/internal/providers/terraform/ibm/en_destination_iphoneos.go b/internal/providers/terraform/ibm/en_destination_iphoneos.go new file mode 100644 index 00000000000..baa5b6cae7e --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_iphoneos.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationIphoneosRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_ios", + RFunc: newEnDestinationIphoneos, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestinationIphoneos(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestinationIphoneos{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_iphoneos_test.go b/internal/providers/terraform/ibm/en_destination_iphoneos_test.go new file mode 100644 index 00000000000..07b167b0819 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_iphoneos_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestinationIphoneos(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_iphoneos_test") +} diff --git a/internal/providers/terraform/ibm/en_destination_safari.go b/internal/providers/terraform/ibm/en_destination_safari.go new file mode 100644 index 00000000000..d03d7700c52 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_safari.go @@ -0,0 +1,46 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnDestinationSafariRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_destination_safari", + RFunc: newEnDestinationSafari, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnDestinationSafari(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + is_pre_prod := d.Get("config.0.params.0.pre_prod").Bool() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnDestinationSafari{ + Address: d.Address, + IsPreProd: is_pre_prod, + Name: name, + Plan: plan, + Region: region, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["pre-prod"] = is_pre_prod + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_destination_safari_test.go b/internal/providers/terraform/ibm/en_destination_safari_test.go new file mode 100644 index 00000000000..a19e4d3ed8e --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_safari_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestinationSafari(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_safari_test") +} diff --git a/internal/providers/terraform/ibm/en_destination_test.go b/internal/providers/terraform/ibm/en_destination_test.go new file mode 100644 index 00000000000..da9ba12e559 --- /dev/null +++ b/internal/providers/terraform/ibm/en_destination_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnDestination(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_destination_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription.go b/internal/providers/terraform/ibm/en_subscription.go new file mode 100644 index 00000000000..d44a1d79312 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription.go @@ -0,0 +1,42 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_android", + RFunc: newEnSubscription, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscription(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscription{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_ce.go b/internal/providers/terraform/ibm/en_subscription_ce.go new file mode 100644 index 00000000000..acb709acd49 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_ce.go @@ -0,0 +1,42 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionCeRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_ce", + RFunc: newEnSubscriptionCe, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionCe(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionCe{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_ce_test.go b/internal/providers/terraform/ibm/en_subscription_ce_test.go new file mode 100644 index 00000000000..98d393186e5 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_ce_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionCe(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_ce_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_chrome.go b/internal/providers/terraform/ibm/en_subscription_chrome.go new file mode 100644 index 00000000000..c21f1c0dad2 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_chrome.go @@ -0,0 +1,42 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionChromeRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_chrome", + RFunc: newEnSubscriptionChrome, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionChrome(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionChrome{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_chrome_test.go b/internal/providers/terraform/ibm/en_subscription_chrome_test.go new file mode 100644 index 00000000000..622b5487571 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_chrome_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionChrome(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_chrome_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_cos.go b/internal/providers/terraform/ibm/en_subscription_cos.go new file mode 100644 index 00000000000..89dd6c1a225 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_cos.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionCosRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_cos", + RFunc: newEnSubscriptionCos, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionCos(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionCos{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_cos_test.go b/internal/providers/terraform/ibm/en_subscription_cos_test.go new file mode 100644 index 00000000000..c271ee6d95f --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_cos_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionCos(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_cos_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_custom_email.go b/internal/providers/terraform/ibm/en_subscription_custom_email.go new file mode 100644 index 00000000000..8a6c382e46d --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_custom_email.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionCustomEmailRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_custom_email", + RFunc: newEnSubscriptionCustomEmail, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionCustomEmail(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionCustomEmail{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_custom_email_test.go b/internal/providers/terraform/ibm/en_subscription_custom_email_test.go new file mode 100644 index 00000000000..695b8aefc02 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_custom_email_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionCustomEmail(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_custom_email_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_email.go b/internal/providers/terraform/ibm/en_subscription_email.go new file mode 100644 index 00000000000..f2b14101e0e --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_email.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionEmailRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_email", + RFunc: newEnSubscriptionEmail, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionEmail(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionEmail{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_email_test.go b/internal/providers/terraform/ibm/en_subscription_email_test.go new file mode 100644 index 00000000000..73503c907dc --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_email_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionEmail(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_email_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_firefox.go b/internal/providers/terraform/ibm/en_subscription_firefox.go new file mode 100644 index 00000000000..76108fb2032 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_firefox.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionFirefoxRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_firefox", + RFunc: newEnSubscriptionFirefox, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionFirefox(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionFirefox{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_firefox_test.go b/internal/providers/terraform/ibm/en_subscription_firefox_test.go new file mode 100644 index 00000000000..bff757d0cc9 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_firefox_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionFirefox(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_firefox_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_huawei.go b/internal/providers/terraform/ibm/en_subscription_huawei.go new file mode 100644 index 00000000000..73f7caf97f5 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_huawei.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionHuaweiRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_huawei", + RFunc: newEnSubscriptionHuawei, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionHuawei(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionHuawei{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_huawei_test.go b/internal/providers/terraform/ibm/en_subscription_huawei_test.go new file mode 100644 index 00000000000..c8f740b096b --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_huawei_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionHuawei(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_huawei_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_iphoneos.go b/internal/providers/terraform/ibm/en_subscription_iphoneos.go new file mode 100644 index 00000000000..70292b2ef48 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_iphoneos.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionIphoneosRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_ios", + RFunc: newEnSubscriptionIphoneos, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionIphoneos(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionIphoneos{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_iphoneos_test.go b/internal/providers/terraform/ibm/en_subscription_iphoneos_test.go new file mode 100644 index 00000000000..54ef714cb58 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_iphoneos_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionIphoneos(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_iphoneos_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_msteams.go b/internal/providers/terraform/ibm/en_subscription_msteams.go new file mode 100644 index 00000000000..54cfe040b51 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_msteams.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionMsteamsRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_msteams", + RFunc: newEnSubscriptionMsteams, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionMsteams(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionMsteams{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_msteams_test.go b/internal/providers/terraform/ibm/en_subscription_msteams_test.go new file mode 100644 index 00000000000..2eb37626b8e --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_msteams_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionMsteams(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_msteams_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_pagerduty.go b/internal/providers/terraform/ibm/en_subscription_pagerduty.go new file mode 100644 index 00000000000..0ea45da90dd --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_pagerduty.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionPagerdutyRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_pagerduty", + RFunc: newEnSubscriptionPagerduty, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionPagerduty(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionPagerduty{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_pagerduty_test.go b/internal/providers/terraform/ibm/en_subscription_pagerduty_test.go new file mode 100644 index 00000000000..b8114987da3 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_pagerduty_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionPagerduty(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_pagerduty_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_safari.go b/internal/providers/terraform/ibm/en_subscription_safari.go new file mode 100644 index 00000000000..aa5900f7d07 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_safari.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionSafariRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_safari", + RFunc: newEnSubscriptionSafari, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionSafari(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionSafari{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_safari_test.go b/internal/providers/terraform/ibm/en_subscription_safari_test.go new file mode 100644 index 00000000000..c55e667688c --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_safari_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionSafari(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_safari_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_slack.go b/internal/providers/terraform/ibm/en_subscription_slack.go new file mode 100644 index 00000000000..20d502d16e4 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_slack.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionSlackRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_slack", + RFunc: newEnSubscriptionSlack, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionSlack(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionSlack{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_slack_test.go b/internal/providers/terraform/ibm/en_subscription_slack_test.go new file mode 100644 index 00000000000..46ffee0c426 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_slack_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionSlack(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_slack_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_sms.go b/internal/providers/terraform/ibm/en_subscription_sms.go new file mode 100644 index 00000000000..2cb4823e24c --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_sms.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionSmsRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_sms", + RFunc: newEnSubscriptionSms, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionSms(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionSms{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_sms_test.go b/internal/providers/terraform/ibm/en_subscription_sms_test.go new file mode 100644 index 00000000000..ca9d071c9e8 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_sms_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionSms(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_sms_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_sn.go b/internal/providers/terraform/ibm/en_subscription_sn.go new file mode 100644 index 00000000000..6ca17aeac94 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_sn.go @@ -0,0 +1,42 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionSnRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_sn", + RFunc: newEnSubscriptionSn, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionSn(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionSn{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_sn_test.go b/internal/providers/terraform/ibm/en_subscription_sn_test.go new file mode 100644 index 00000000000..1c38d3549c7 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_sn_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionSn(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_sn_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_test.go b/internal/providers/terraform/ibm/en_subscription_test.go new file mode 100644 index 00000000000..57bb9abc42e --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscription(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_test") +} diff --git a/internal/providers/terraform/ibm/en_subscription_webhook.go b/internal/providers/terraform/ibm/en_subscription_webhook.go new file mode 100644 index 00000000000..ff91aef7ad8 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_webhook.go @@ -0,0 +1,43 @@ +package ibm + +import ( + "github.com/infracost/infracost/internal/resources/ibm" + "github.com/infracost/infracost/internal/schema" +) + +func getEnSubscriptionWebhookRegistryItem() *schema.RegistryItem { + return &schema.RegistryItem{ + Name: "ibm_en_subscription_webhook", + RFunc: newEnSubscriptionWebhook, + ReferenceAttributes: []string{"instance_guid"}, + } +} + +func newEnSubscriptionWebhook(d *schema.ResourceData, u *schema.UsageData) *schema.Resource { + + region := d.Get("region").String() + name := d.Get("name").String() + + var plan string + enReferenceAttributes := d.References("instance_guid") + if len(enReferenceAttributes) > 0 { + plan = enReferenceAttributes[0].Get("plan").String() + } + + r := &ibm.EnSubscriptionWebhook{ + Address: d.Address, + Region: region, + Name: name, + Plan: plan, + } + r.PopulateUsage(u) + + configuration := make(map[string]any) + configuration["name"] = name + configuration["plan"] = plan + configuration["region"] = region + + SetCatalogMetadata(d, d.Type, configuration) + + return r.BuildResource() +} diff --git a/internal/providers/terraform/ibm/en_subscription_webhook_test.go b/internal/providers/terraform/ibm/en_subscription_webhook_test.go new file mode 100644 index 00000000000..e8666e9d7f1 --- /dev/null +++ b/internal/providers/terraform/ibm/en_subscription_webhook_test.go @@ -0,0 +1,16 @@ +package ibm_test + +import ( + "testing" + + "github.com/infracost/infracost/internal/providers/terraform/tftest" +) + +func TestEnSubscriptionWebhook(t *testing.T) { + t.Parallel() + if testing.Short() { + t.Skip("skipping test in short mode") + } + + tftest.GoldenFileResourceTests(t, "en_subscription_webhook_test") +} diff --git a/internal/providers/terraform/ibm/ibm.go b/internal/providers/terraform/ibm/ibm.go index f546e3a16c5..8be81bfd820 100644 --- a/internal/providers/terraform/ibm/ibm.go +++ b/internal/providers/terraform/ibm/ibm.go @@ -51,45 +51,46 @@ type catalogMetadata struct { // Map between terraform type and global catalog id. For ibm_resource_instance, the service // field already matches the global catalog id, so they do not need to be mapped. eg: "kms" var globalCatalogServiceId = map[string]catalogMetadata{ - "ibm_is_vpc": {"is.vpc", []string{"ibm_is_flow_log", "ibm_is_share"}, nil, "https://cloud.ibm.com/vpc-ext/provision/vpc"}, + "aiopenscale": {"2ad019f3-0fd6-4c25-966d-f3952481a870", []string{}, nil, "https://cloud.ibm.com/catalog/services/watsonxgovernance"}, + "appconnect": {"96a0ebf2-2a02-4e32-815f-7c09a1268c78", []string{}, nil, "https://www.ibm.com/products/app-connect/pricing"}, + "appid": {"AdvancedMobileAccess-d6aece47-d840-45b0-8ab9-ad15354deeea", []string{}, nil, "https://cloud.ibm.com/catalog/services/appid"}, + "cloud-object-storage": {"dff97f5c-bc5e-4455-b470-411c3edbe49c", []string{}, nil, "https://cloud.ibm.com/objectstorage/create#pricing"}, + "compliance": {"compliance", []string{}, nil, "https://cloud.ibm.com/catalog/services/security-and-compliance-center"}, + "continuous-delivery": {"59b735ee-5938-4ebd-a6b2-541aef2d1f68", []string{}, nil, "https://cloud.ibm.com/catalog/services/continuous-delivery"}, + "conversation": {"7045626d-55e3-4418-be11-683a26dbc1e5", []string{}, nil, "https://cloud.ibm.com/catalog/services/watsonx-assistant"}, + "data-science-experience": {"39ba9d4c-b1c5-4cc3-a163-38b580121e01", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-studio"}, + "databases-for-elasticsearch": {"databases-for-elasticsearch", []string{}, nil, "https://cloud.ibm.com/databases/databases-for-elasticsearch/create"}, + "databases-for-postgresql": {"databases-for-postgresql", []string{}, nil, "https://cloud.ibm.com/databases/databases-for-postgresql/create"}, + "discovery": {"76b7bf22-b443-47db-b3db-066ba2988f47", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-discovery"}, + "dns-svcs": {"b4ed8a30-936f-11e9-b289-1d079699cbe5", []string{}, nil, "https://cloud.ibm.com/catalog/services/dns-services"}, + "event-notifications": {"ecdb4690-c2d8-11eb-bff1-4f7b9d2dfe41", []string{}, nil, "https://cloud.ibm.com/catalog/services/event-notifications"}, + "ibm_cloudant": {"Cloudant", []string{}, nil, "https://cloud.ibm.com/catalog/services/cloudant"}, "ibm_container_vpc_cluster": {"containers-kubernetes", []string{}, nil, "https://cloud.ibm.com/kubernetes/catalog/about#pricing"}, "ibm_container_vpc_worker_pool": {"containers-kubernetes", []string{}, nil, "https://cloud.ibm.com/kubernetes/catalog/about#pricing"}, + "ibm_cos_bucket": {"Object Storage Bucket", []string{}, nil, "https://cloud.ibm.com/objectstorage/create#pricing"}, + "ibm_is_floating_ip": {"is.floating-ip", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/vs"}, + "ibm_is_flow_log": {"is.flow-log-collector", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/flowLog"}, "ibm_is_instance": {"is.instance", []string{"ibm_is_ssh_key", "ibm_is_floating_ip"}, nil, "https://cloud.ibm.com/vpc-ext/provision/vs"}, + "ibm_is_lb": {"is.load-balancer", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/loadBalancer"}, + "ibm_is_share": {"is.share", []string{}, nil, "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-faqs&interface=ui#faq-fs-billing"}, "ibm_is_volume": {"is.volume", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/storage"}, + "ibm_is_vpc": {"is.vpc", []string{"ibm_is_flow_log", "ibm_is_share"}, nil, "https://cloud.ibm.com/vpc-ext/provision/vpc"}, "ibm_is_vpn_gateway": {"is.vpn", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/vpngateway"}, - "ibm_tg_gateway": {"f38a4da0-c353-11e9-83b6-a36a57a97a06", []string{}, nil, "https://cloud.ibm.com/interconnectivity/transit/provision"}, - "ibm_is_floating_ip": {"is.floating-ip", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/vs"}, - "ibm_is_flow_log": {"is.flow-log-collector", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/flowLog"}, - "ibm_cloudant": {"Cloudant", []string{}, nil, "https://cloud.ibm.com/catalog/services/cloudant"}, + "ibm_is_vpn_server": {"is.vpn-server", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/vpnserver"}, "ibm_pi_instance": {"Power Systems Virtual Server", []string{}, nil, "https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server"}, "ibm_pi_volume": {"Power Systems Storage Volume", []string{}, nil, "https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server#storage-type"}, - "ibm_cos_bucket": {"Object Storage Bucket", []string{}, nil, "https://cloud.ibm.com/objectstorage/create#pricing"}, - "ibm_is_lb": {"is.load-balancer", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/loadBalancer"}, + "ibm_tg_gateway": {"f38a4da0-c353-11e9-83b6-a36a57a97a06", []string{}, nil, "https://cloud.ibm.com/interconnectivity/transit/provision"}, "kms": {"ee41347f-b18e-4ca6-bf80-b5467c63f9a6", []string{}, nil, "https://cloud.ibm.com/catalog/services/key-protect"}, - "cloud-object-storage": {"dff97f5c-bc5e-4455-b470-411c3edbe49c", []string{}, nil, "https://cloud.ibm.com/objectstorage/create#pricing"}, - "roks": {"containers.kubernetes.cluster.roks", []string{}, nil, "https://cloud.ibm.com/kubernetes/catalog/about?platformType=openshift"}, - "pm-20": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-machine-learning"}, - "data-science-experience": {"39ba9d4c-b1c5-4cc3-a163-38b580121e01", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-studio"}, - "discovery": {"76b7bf22-b443-47db-b3db-066ba2988f47", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-discovery"}, - "wx": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil, "https://cloud.ibm.com/watsonx/overview"}, - "conversation": {"7045626d-55e3-4418-be11-683a26dbc1e5", []string{}, nil, "https://cloud.ibm.com/catalog/services/watsonx-assistant"}, - "aiopenscale": {"2ad019f3-0fd6-4c25-966d-f3952481a870", []string{}, nil, "https://cloud.ibm.com/catalog/services/watsonxgovernance"}, - "sysdig-monitor": {"090c2c10-8c38-11e8-bec2-493df9c49eb8", []string{}, nil, "https://cloud.ibm.com/observe/catalog/ibm-cloud-monitoring"}, - "sysdig-secure": {"e831e900-82d6-11ec-95c5-c12c5a5d9687", []string{}, nil, "https://cloud.ibm.com/workload-protection/catalog/security-and-compliance-center-workload-protection"}, "logdna": {"e13e1860-959c-11e8-871e-ad157af61ad7", []string{}, nil, "https://cloud.ibm.com/catalog/services/logdna"}, - "databases-for-postgresql": {"databases-for-postgresql", []string{}, nil, "https://cloud.ibm.com/databases/databases-for-postgresql/create"}, - "databases-for-elasticsearch": {"databases-for-elasticsearch", []string{}, nil, "https://cloud.ibm.com/databases/databases-for-elasticsearch/create"}, - "secrets-manager": {"ebc0cdb0-af2a-11ea-98c7-29e5db822649", []string{}, nil, "https://cloud.ibm.com/catalog/services/secrets-manager"}, - "appid": {"AdvancedMobileAccess-d6aece47-d840-45b0-8ab9-ad15354deeea", []string{}, nil, "https://cloud.ibm.com/catalog/services/appid"}, - "appconnect": {"96a0ebf2-2a02-4e32-815f-7c09a1268c78", []string{}, nil, "https://www.ibm.com/products/app-connect/pricing"}, - "power-iaas": {"abd259f0-9990-11e8-acc8-b9f54a8f1661", []string{}, nil, "https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server"}, "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"}, - "ibm_is_share": {"is.share", []string{}, nil, "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-faqs&interface=ui#faq-fs-billing"}, - "ibm_is_vpn_server": {"is.vpn-server", []string{}, nil, "https://cloud.ibm.com/vpc-ext/provision/vpnserver"}, + "pm-20": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil, "https://cloud.ibm.com/catalog/services/watson-machine-learning"}, + "power-iaas": {"abd259f0-9990-11e8-acc8-b9f54a8f1661", []string{}, nil, "https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server"}, + "roks": {"containers.kubernetes.cluster.roks", []string{}, nil, "https://cloud.ibm.com/kubernetes/catalog/about?platformType=openshift"}, + "secrets-manager": {"ebc0cdb0-af2a-11ea-98c7-29e5db822649", []string{}, nil, "https://cloud.ibm.com/catalog/services/secrets-manager"}, + "sysdig-monitor": {"090c2c10-8c38-11e8-bec2-493df9c49eb8", []string{}, nil, "https://cloud.ibm.com/observe/catalog/ibm-cloud-monitoring"}, + "sysdig-secure": {"e831e900-82d6-11ec-95c5-c12c5a5d9687", []string{}, nil, "https://cloud.ibm.com/workload-protection/catalog/security-and-compliance-center-workload-protection"}, + "wx": {"51c53b72-918f-4869-b834-2d99eb28422a", []string{}, nil, "https://cloud.ibm.com/watsonx/overview"}, } func SetCatalogMetadata(d *schema.ResourceData, resourceType string, config map[string]any) { diff --git a/internal/providers/terraform/ibm/registry.go b/internal/providers/terraform/ibm/registry.go index a05e4e57c99..0fe13fa6c16 100644 --- a/internal/providers/terraform/ibm/registry.go +++ b/internal/providers/terraform/ibm/registry.go @@ -25,6 +25,28 @@ var ResourceRegistry []*schema.RegistryItem = []*schema.RegistryItem{ getDatabaseRegistryItem(), getIsShareRegistryItem(), getIsVpnServerRegistryItem(), + getEnDestinationChromeRegistryItem(), + getEnDestinationFirefoxRegistryItem(), + getEnDestinationHuaweiRegistryItem(), + getEnDestinationIphoneosRegistryItem(), // iOS + getEnDestinationRegistryItem(), // Android + getEnDestinationSafariRegistryItem(), + getEnSubscriptionCeRegistryItem(), + getEnSubscriptionChromeRegistryItem(), + getEnSubscriptionCosRegistryItem(), + getEnSubscriptionCustomEmailRegistryItem(), + getEnSubscriptionEmailRegistryItem(), + getEnSubscriptionFirefoxRegistryItem(), + getEnSubscriptionHuaweiRegistryItem(), + getEnSubscriptionIphoneosRegistryItem(), // iOS + getEnSubscriptionMsteamsRegistryItem(), + getEnSubscriptionPagerdutyRegistryItem(), + getEnSubscriptionRegistryItem(), // Android + getEnSubscriptionSafariRegistryItem(), + getEnSubscriptionSlackRegistryItem(), + getEnSubscriptionSmsRegistryItem(), + getEnSubscriptionSnRegistryItem(), + getEnSubscriptionWebhookRegistryItem(), } // FreeResources grouped alphabetically @@ -85,7 +107,7 @@ var FreeResources = []string{ "ibm_cd_toolchain_tool_sonarqube", "ibm_cloud_shell_account_settings", "ibm_cloudant_database", - "ibm_code_engine_binding", + "ibm_code_engine_binding", "ibm_code_engine_config_map", "ibm_code_engine_domain_mapping", "ibm_code_engine_project", @@ -93,6 +115,13 @@ var FreeResources = []string{ "ibm_container_addons", "ibm_cos_bucket_object_lock_configuration", "ibm_dns_custom_resolver", + "ibm_en_destination_ce", + "ibm_en_email_template", + "ibm_en_ibmsource", + "ibm_en_integration", + "ibm_en_integration_cos", + "ibm_en_source", + "ibm_en_topic", "ibm_event_streams_schema", "ibm_event_streams_topic", "ibm_iam_access_group", @@ -133,6 +162,8 @@ var FreeResources = []string{ "ibm_is_vpc_routing_table", "ibm_is_vpc_routing_table_route", "ibm_is_vpn_gateway_connection", + "ibm_is_vpn_server_client", + "ibm_is_vpn_server_route", "ibm_kms_instance_policies", "ibm_kms_key", "ibm_kms_key_policies", @@ -187,8 +218,19 @@ var FreeResources = []string{ "ibm_sm_service_credentials_secret", "ibm_sm_username_password_secret", "ibm_tg_connection", - "ibm_is_vpn_server_client", - "ibm_is_vpn_server_route", + "ibm_en_destination_cos", + "ibm_en_destination_custom_email", + "ibm_en_destination_custom_sms", + "ibm_en_destination_msteams", + "ibm_en_destination_pagerduty", + "ibm_en_destination_slack", + "ibm_en_destination_sn", + "ibm_en_destination_webhook", + "ibm_en_slack_template", + "ibm_en_smtp_configuration", + "ibm_en_smtp_setting", + "ibm_en_smtp_user", + "ibm_en_webhook_template", } var UsageOnlyResources = []string{ diff --git a/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.golden new file mode 100644 index 00000000000..66ef4d28661 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_chrome.destination_chrome_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_chrome.destination_chrome_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_chrome.destination_chrome_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_chrome.destination_chrome_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.tf new file mode 100644 index 00000000000..242cafb3073 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.tf @@ -0,0 +1,56 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_chrome" "destination_chrome_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Chrome Destination" + type = "push_chrome" + collect_failed_events = false + description = "Chrome push destination" + config { + params { + api_key = "apikey" + website_url = "https://testevents.com" + pre_prod = tobool(each.value) + } + } +} + +resource "ibm_en_destination_chrome" "destination_chrome_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Chrome Destination" + type = "push_chrome" + collect_failed_events = false + description = "Chrome push destination" + config { + params { + api_key = "apikey" + website_url = "https://testevents.com" + pre_prod = tobool(each.value) + } + } +} + diff --git a/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_chrome_test/en_destination_chrome_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.golden new file mode 100644 index 00000000000..dec1748ef58 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_firefox.destination_firefox_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_firefox.destination_firefox_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_firefox.destination_firefox_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_firefox.destination_firefox_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.tf new file mode 100644 index 00000000000..952b41fc118 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.tf @@ -0,0 +1,54 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_firefox" "destination_firefox_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Firefox Destination" + type = "push_firefox" + collect_failed_events = false + description = "Firefox push destination" + config { + params { + website_url = "https://testevents.com" + pre_prod = tobool(each.value) + } + } +} + +resource "ibm_en_destination_firefox" "destination_firefox_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Firefox Destination" + type = "push_firefox" + collect_failed_events = false + description = "Firefox push destination" + config { + params { + website_url = "https://testevents.com" + pre_prod = tobool(each.value) + } + } +} + diff --git a/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_firefox_test/en_destination_firefox_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.golden new file mode 100644 index 00000000000..cf9ed510a4c --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_huawei.destination_huawei_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_huawei.destination_huawei_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_huawei.destination_huawei_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_huawei.destination_huawei_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.tf new file mode 100644 index 00000000000..d216287be15 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.tf @@ -0,0 +1,57 @@ + +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_huawei" "destination_huawei_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Huawei Destination" + type = "push_huawei" + collect_failed_events = false + description = "Huawei push destination" + config { + params { + client_id = "clientid" + client_secret = "clientsecret" + pre_prod = tobool(each.value) + } + } +} + +resource "ibm_en_destination_huawei" "destination_huawei_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Huawei Destination" + type = "push_huawei" + collect_failed_events = false + description = "Huawei push destination" + config { + params { + client_id = "clientid" + client_secret = "clientsecret" // pragma: allowlist secret + pre_prod = tobool(each.value) + } + } +} + diff --git a/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_huawei_test/en_destination_huawei_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.golden new file mode 100644 index 00000000000..1c69fb700f1 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_ios.destination_ios_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_ios.destination_ios_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_ios.destination_ios_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_ios.destination_ios_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.tf new file mode 100644 index 00000000000..a32bcb10ba6 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.tf @@ -0,0 +1,59 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_ios" "destination_ios_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "iOS Destination Auth" + type = "push_ios" + collect_failed_events = false + certificate_content_type = "p8" + certificate = "${path.module}/Certificates/Auth.p8" + description = "iOS destination with P8" + config { + params { + cert_type = "p8" + is_sandbox = true + pre_prod = tobool(each.value) + } + } +} + +resource "ibm_en_destination_ios" "destination_ios_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "iOS Destination Auth" + type = "push_ios" + collect_failed_events = false + certificate_content_type = "p8" + certificate = "${path.module}/Certificates/Auth.p8" + description = "iOS destination with P8" + config { + params { + cert_type = "p8" + is_sandbox = true + pre_prod = tobool(each.value) + } + } +} diff --git a/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_iphoneos_test/en_destination_iphoneos_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.golden new file mode 100644 index 00000000000..0b2b1199b9d --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_safari.destination_safari_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_safari.destination_safari_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_safari.destination_safari_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_safari.destination_safari_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.tf new file mode 100644 index 00000000000..9bc479914d8 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.tf @@ -0,0 +1,66 @@ + +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_safari" "destination_safari_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Safari Destination" + certificate = "${path.module}/Certificates/safaricert.p12" + collect_failed_events = false + description = "Safari push destination" + type = "push_safari" + config { + params { + cert_type = "p12" + password = "apnscertpassword" + url_format_string = "https://test.petstorez.com" + website_name = "petstore" + website_push_id = "petzz" + website_url = "https://test.petstorez.com" + pre_prod = tobool(each.value) + } + } +} + +resource "ibm_en_destination_safari" "destination_safari_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Safari Destination" + certificate = "${path.module}/Certificates/safaricert.p12" + collect_failed_events = false + description = "Safari push destination" + type = "push_safari" + config { + params { + cert_type = "p12" + password = "apnscertpassword" + url_format_string = "https://test.petstorez.com" + website_name = "petstore" + website_push_id = "petzz" + website_url = "https://test.petstorez.com" + pre_prod = tobool(each.value) + } + } +} \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_safari_test/en_destination_safari_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.golden b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.golden new file mode 100644 index 00000000000..ab8d149d548 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_destination_android.destination_android_lite["false"] + └─ Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_android.destination_android_lite["true"] + └─ Pre-Prod Push Destination Instances (Lite plan) 1 Instance $0.00 + + ibm_en_destination_android.destination_android_standard["false"] + └─ Push Destination Instances (Standard plan) 1 Instance $35.00 + + ibm_en_destination_android.destination_android_standard["true"] + └─ Pre-Prod Push Destination Instances (Standard plan) 1 Instance $10.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $45.00 +────────────────────────────────── +6 cloud resources were detected: +∙ 6 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.tf b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.tf new file mode 100644 index 00000000000..f852da9d0e9 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.tf @@ -0,0 +1,57 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + destination_pre_prod = ["true", "false"] + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_destination_android" "destination_android_lite" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Android Destination" + type = "push_android" + collect_failed_events = false + description = "Android push destination" + config { + params { + project_id = "projectid" + private_key = "privatekey" + client_email = "user@mail.com" + pre_prod = each.value + } + } +} + +resource "ibm_en_destination_android" "destination_android_standard" { + for_each = toset(local.event_notifications.destination_pre_prod) + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Android Destination" + type = "push_android" + collect_failed_events = false + description = "Android push destination" + config { + params { + project_id = "projectid" + private_key = "privatekey" + client_email = "user@mail.com" + pre_prod = tobool(each.value) + } + } +} diff --git a/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.usage.yml new file mode 100644 index 00000000000..6b38d343c6a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_destination_test/en_destination_test.usage.yml @@ -0,0 +1,2 @@ +version: 0.1 +resource_usage: \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.golden new file mode 100644 index 00000000000..79314806482 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_ce.subscription_ce_lite + └─ Outbound Code Engine HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_ce.subscription_ce_standard + └─ Outbound Code Engine HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_ce.subscription_ce_standard_no_usage + └─ Outbound Code Engine HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.tf new file mode 100644 index 00000000000..adbdb626664 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_ce" "subscription_ce_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Code Engine Subscription" + description = "Code Engine Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_ce" "subscription_ce_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Code Engine Subscription" + description = "Code Engine Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_ce" "subscription_ce_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Code Engine Subscription" + description = "Code Engine Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.usage.yml new file mode 100644 index 00000000000..85a4b3b58fc --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_ce_test/en_subscription_ce_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_ce.subscription_ce_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_ce.subscription_ce_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.golden new file mode 100644 index 00000000000..745d06aa422 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_chrome.subscription_chrome_lite + └─ Outbound Android Push Messages (Lite plan) 1 Messages $0.00 + + ibm_en_subscription_chrome.subscription_chrome_standard + └─ Outbound Android Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound Android Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_chrome.subscription_chrome_standard_no_usage + └─ Outbound Android Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound Android Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.tf new file mode 100644 index 00000000000..796db6608aa --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_chrome" "subscription_chrome_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Chrome Subscription" + description = "Chrome Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_chrome" "subscription_chrome_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Chrome Subscription" + description = "Chrome Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_chrome" "subscription_chrome_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Chrome Subscription" + description = "Chrome Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.usage.yml new file mode 100644 index 00000000000..29a233cdfaa --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_chrome_test/en_subscription_chrome_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_chrome.subscription_chrome_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_chrome.subscription_chrome_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.golden new file mode 100644 index 00000000000..a7129d014f5 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_cos.subscription_cos_lite + └─ Outbound Cloud Object Storage HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_cos.subscription_cos_standard + └─ Outbound Cloud Object Storage HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_cos.subscription_cos_standard_no_usage + └─ Outbound Cloud Object Storage HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.tf new file mode 100644 index 00000000000..20b229991d8 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_cos" "subscription_cos_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Cloud Object Storage Subscription" + description = "Cloud Object Storage Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_cos" "subscription_cos_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Cloud Object Storage Subscription" + description = "Cloud Object Storage Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_cos" "subscription_cos_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Cloud Object Storage Subscription" + description = "Cloud Object Storage Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.usage.yml new file mode 100644 index 00000000000..4da30965882 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_cos_test/en_subscription_cos_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_cos.subscription_cos_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_cos.subscription_cos_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.golden new file mode 100644 index 00000000000..0b00f0c66c9 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_custom_email.subscription_custom_email_lite + ├─ Outbound Custom Domain E-mail Messages (Lite plan) (Max. 20) 20 Messages $0.00 + └─ Outbound Transmitted E-mail Messages (Lite plan) 1 GB $0.00 + + ibm_en_subscription_custom_email.subscription_custom_email_standard + ├─ Outbound Custom Domain E-mail Messages (Standard plan) 1,000 Messages $0.15 + └─ Outbound Transmitted E-mail Messages (Standard plan) 1 GB $0.12 + + ibm_en_subscription_custom_email.subscription_custom_email_standard_no_usage + ├─ Outbound Custom Domain E-mail Messages (Standard plan) Monthly cost depends on usage: $0.00015 per Messages + └─ Outbound Transmitted E-mail Messages (Standard plan) Monthly cost depends on usage: $0.12 per GB + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.27 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.tf new file mode 100644 index 00000000000..77874a43d4d --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_custom_email" "subscription_custom_email_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Custom Domain E-mail Subscription" + description = "Custom Domain E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_custom_email" "subscription_custom_email_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Custom Domain E-mail Subscription" + description = "Custom Domain E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_custom_email" "subscription_custom_email_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Custom Domain E-mail Subscription" + description = "Custom Domain E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.usage.yml new file mode 100644 index 00000000000..40b7b6ced92 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_custom_email_test/en_subscription_custom_email_test.usage.yml @@ -0,0 +1,8 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_custom_email.subscription_custom_email_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL: 1000 + event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL: 1 + ibm_en_subscription_custom_email.subscription_custom_email_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL: 1000 + event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL: 1 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.golden new file mode 100644 index 00000000000..1590dbe12d6 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_email.subscription_email_lite + └─ Outbound E-mail Messages (Lite plan) (Max. 20) 20 Messages $0.00 + + ibm_en_subscription_email.subscription_email_standard + └─ Outbound E-mail Messages (Standard plan) 100,000 Messages $4.31 + + ibm_en_subscription_email.subscription_email_standard_no_usage + └─ Outbound E-mail Messages (Standard plan) Monthly cost depends on usage: $0.0000431 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $4.31 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.tf new file mode 100644 index 00000000000..524d6151be9 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_email" "subscription_email_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "E-mail Subscription" + description = "E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_email" "subscription_email_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "E-mail Subscription" + description = "E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_email" "subscription_email_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "E-mail Subscription" + description = "E-mail Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.usage.yml new file mode 100644 index 00000000000..44acf4d0a51 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_email_test/en_subscription_email_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_email.subscription_email_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS: 100000 + ibm_en_subscription_email.subscription_email_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS: 100000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.golden new file mode 100644 index 00000000000..04b24a0be8e --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_firefox.subscription_firefox_lite + └─ Outbound Firefox Push Messages (Lite plan: Max. 1000 per destination) 1 Messages $0.00 + + ibm_en_subscription_firefox.subscription_firefox_standard + └─ Outbound Firefox Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound Firefox Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_firefox.subscription_firefox_standard_no_usage + └─ Outbound Firefox Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound Firefox Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.tf new file mode 100644 index 00000000000..499ed37a374 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.tf @@ -0,0 +1,47 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_firefox" "subscription_firefox_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Firefox Subscription" + description = "Firefox Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_firefox" "subscription_firefox_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Firefox Subscription" + description = "Firefox Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_firefox" "subscription_firefox_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Firefox Subscription" + description = "Firefox Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.usage.yml new file mode 100644 index 00000000000..ca19b0c1001 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_firefox_test/en_subscription_firefox_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_firefox.subscription_firefox_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_firefox.subscription_firefox_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.golden new file mode 100644 index 00000000000..e45b8fd7df0 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_huawei.subscription_huawei_lite + └─ Outbound Huawei Push Messages (Lite plan) (Max. 1,000 per destination) 1 Messages $0.00 + + ibm_en_subscription_huawei.subscription_huawei_standard + └─ Outbound Huawei Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound Huawei Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_huawei.subscription_huawei_standard_no_usage + └─ Outbound Huawei Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound Huawei Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.tf new file mode 100644 index 00000000000..05f54e2bcb0 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_huawei" "subscription_huawei_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Huawei Subscription" + description = "Huawei Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_huawei" "subscription_huawei_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Huawei Subscription" + description = "Huawei Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_huawei" "subscription_huawei_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Huawei Subscription" + description = "Huawei Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.usage.yml new file mode 100644 index 00000000000..92338194bc9 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_huawei_test/en_subscription_huawei_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_huawei.subscription_huawei_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_huawei.subscription_huawei_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.golden new file mode 100644 index 00000000000..ab1ed668ce4 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_ios.subscription_ios_lite + └─ Outbound iOS Push Messages (Lite plan) (Max. 1,000 per destination) 1 Messages $0.00 + + ibm_en_subscription_ios.subscription_ios_standard + └─ Outbound iOS Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound iOS Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_ios.subscription_ios_standard_no_usage + └─ Outbound iOS Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound iOS Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.tf new file mode 100644 index 00000000000..8e952204d37 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_ios" "subscription_ios_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "iOS Subscription" + description = "iOS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_ios" "subscription_ios_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "iOS Subscription" + description = "iOS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_ios" "subscription_ios_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "iOS Subscription" + description = "iOS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.usage.yml new file mode 100644 index 00000000000..c3aa245c6b3 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_iphoneos_test/en_subscription_iphoneos_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_ios.subscription_ios_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_ios.subscription_ios_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.golden new file mode 100644 index 00000000000..147f283339b --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_msteams.subscription_msteams_lite + └─ Outbound Microsoft Teams HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_msteams.subscription_msteams_standard + └─ Outbound Microsoft Teams HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_msteams.subscription_msteams_standard_no_usage + └─ Outbound Microsoft Teams HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.tf new file mode 100644 index 00000000000..8421fa788bd --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.tf @@ -0,0 +1,47 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_msteams" "subscription_msteams_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Microsoft Teams Subscription" + description = "Microsoft Teams Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_msteams" "subscription_msteams_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Microsoft Teams Subscription" + description = "Microsoft Teams Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_msteams" "subscription_msteams_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Microsoft Teams Subscription" + description = "Microsoft Teams Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.usage.yml new file mode 100644 index 00000000000..dc9fcfa2b0c --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_msteams_test/en_subscription_msteams_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_msteams.subscription_msteams_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_msteams.subscription_msteams_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.golden new file mode 100644 index 00000000000..5c6278ae862 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_pagerduty.subscription_pagerduty_lite + └─ Outbound PagerDuty HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_pagerduty.subscription_pagerduty_standard + └─ Outbound PagerDuty HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_pagerduty.subscription_pagerduty_standard_no_usage + └─ Outbound PagerDuty HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.tf new file mode 100644 index 00000000000..a5bd9d138b9 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.tf @@ -0,0 +1,47 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_pagerduty" "subscription_pagerduty_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "PagerDuty Subscription" + description = "PagerDuty Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_pagerduty" "subscription_pagerduty_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "PagerDuty Subscription" + description = "PagerDuty Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_pagerduty" "subscription_pagerduty_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "PagerDuty Subscription" + description = "PagerDuty Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.usage.yml new file mode 100644 index 00000000000..e85ffc127ab --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_pagerduty_test/en_subscription_pagerduty_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_pagerduty.subscription_pagerduty_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_pagerduty.subscription_pagerduty_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.golden new file mode 100644 index 00000000000..172e9bcdc18 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_safari.subscription_safari_lite + └─ Outbound Safari Push Messages (Lite plan) (Max. 1,000 per destination) 1 Messages $0.00 + + ibm_en_subscription_safari.subscription_safari_standard + └─ Outbound Safari Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound Safari Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_safari.subscription_safari_standard_no_usage + └─ Outbound Safari Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound Safari Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.tf new file mode 100644 index 00000000000..6f33ac18faa --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_safari" "subscription_safari_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Safari Subscription" + description = "Safari Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_safari" "subscription_safari_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Safari Subscription" + description = "Safari Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_safari" "subscription_safari_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Safari Subscription" + description = "Safari Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.usage.yml new file mode 100644 index 00000000000..fc8af5d4f2f --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_safari_test/en_subscription_safari_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_safari.subscription_safari_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_safari.subscription_safari_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.golden new file mode 100644 index 00000000000..c4cdea3a294 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_slack.subscription_slack_lite + └─ Outbound Slack HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_slack.subscription_slack_standard + └─ Outbound Slack HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_slack.subscription_slack_standard_no_usage + └─ Outbound Slack HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.tf new file mode 100644 index 00000000000..ffc009169f1 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_slack" "subscription_slack_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Slack Subscription" + description = "Slack Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_slack" "subscription_slack_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Slack Subscription" + description = "Slack Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_slack" "subscription_slack_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Slack Subscription" + description = "Slack Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.usage.yml new file mode 100644 index 00000000000..d852e08296c --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_slack_test/en_subscription_slack_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_slack.subscription_slack_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_slack.subscription_slack_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.golden new file mode 100644 index 00000000000..497162da932 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.golden @@ -0,0 +1,25 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_sms.subscription_sms_lite + ├─ Outbound IBM Cloud SMS Message Units (Lite plan) (Max. 20) 20 Message Units $0.00 + └─ SMS Number Setup Resource Units (Lite plan) 1 Resource Units $0.00 + + ibm_en_subscription_sms.subscription_sms_standard + ├─ Outbound IBM Cloud SMS Message Units (Standard plan) 1,000 Message Units $16.15 + └─ SMS Number Setup Resource Units (One-time Fee) (Standard plan) 1 Resource Units $1.00 + + ibm_en_subscription_sms.subscription_sms_standard_no_usage + ├─ Outbound IBM Cloud SMS Message Units (Standard plan) Monthly cost depends on usage: $0.01615 per Message Units + └─ SMS Number Setup Resource Units (One-time Fee) (Standard plan) 1 Resource Units $1.00 + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $18.15 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.tf new file mode 100644 index 00000000000..79f15b6c9d6 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_sms" "subscription_sms_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "SMS Subscription" + description = "SMS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_sms" "subscription_sms_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "SMS Subscription" + description = "SMS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_sms" "subscription_sms_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "SMS Subscription" + description = "SMS Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.usage.yml new file mode 100644 index 00000000000..16ac13dea71 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sms_test/en_subscription_sms_test.usage.yml @@ -0,0 +1,8 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_sms.subscription_sms_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS: 1000 + event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY: 1000 + ibm_en_subscription_sms.subscription_sms_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS: 1000 + event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY: 1000 \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.golden new file mode 100644 index 00000000000..de0819dce44 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_sn.subscription_sn_lite + └─ Outbound ServiceNow HTTP Messages (Lite plan) 1,000,000 Messages $0.00 + + ibm_en_subscription_sn.subscription_sn_standard + └─ Outbound ServiceNow HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_sn.subscription_sn_standard_no_usage + └─ Outbound ServiceNow HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.tf new file mode 100644 index 00000000000..6dc7064d5bf --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_sn" "subscription_sn_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "ServiceNow Subscription" + description = "ServiceNow Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_sn" "subscription_sn_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "ServiceNow Subscription" + description = "ServiceNow Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_sn" "subscription_sn_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "ServiceNow Subscription" + description = "ServiceNow Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.usage.yml new file mode 100644 index 00000000000..a8a3dbc5cb8 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_sn_test/en_subscription_sn_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_sn.subscription_sn_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_sn.subscription_sn_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.golden new file mode 100644 index 00000000000..42f4ee5a8a4 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.golden @@ -0,0 +1,24 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_android.subscription_android_lite + └─ Outbound Android Push Messages (Lite plan) (Max. 1,000 per destination) 1 Messages $0.00 + + ibm_en_subscription_android.subscription_android_standard + └─ Outbound Android Push Messages (Standard plan) (first 100 Messages) 100 Messages $0.00 + └─ Outbound Android Push Messages (Standard plan) (over 100 Messages) 10,000 Messages $0.01 + + ibm_en_subscription_android.subscription_android_standard_no_usage + └─ Outbound Android Push Messages (Standard plan) (first 100 Messages) Monthly cost depends on usage: $0.000001 per Messages + └─ Outbound Android Push Messages (Standard plan) (over 100 Messages) Monthly cost depends on usage: $0.0000005 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $0.01 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.tf new file mode 100644 index 00000000000..ff5261a4b8a --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_android" "subscription_android_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Android Subscription" + description = "Android Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_android" "subscription_android_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Android Subscription" + description = "Android Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_android" "subscription_android_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Android Subscription" + description = "Android Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.usage.yml new file mode 100644 index 00000000000..b88ea59c53f --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_test/en_subscription_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_android.subscription_android_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 1 + ibm_en_subscription_android.subscription_android_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH: 10100 diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.golden b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.golden new file mode 100644 index 00000000000..054dab4ae29 --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.golden @@ -0,0 +1,22 @@ + + Name Monthly Qty Unit Monthly Cost + + ibm_en_subscription_webhook.subscription_webhook_lite + └─ Outbound Webhook HTTP Messages (Lite plan) (Max. 20) 20 Messages $0.00 + + ibm_en_subscription_webhook.subscription_webhook_standard + └─ Outbound Webhook HTTP Messages (Standard plan) 1,000,000 Messages $1.08 + + ibm_en_subscription_webhook.subscription_webhook_standard_no_usage + └─ Outbound Webhook HTTP Messages (Standard plan) Monthly cost depends on usage: $0.00000108 per Messages + + ibm_resource_instance.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + + OVERALL TOTAL $1.08 +────────────────────────────────── +5 cloud resources were detected: +∙ 5 were estimated, 2 of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.tf b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.tf new file mode 100644 index 00000000000..714caacb26b --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + } + } +} + +locals { + event_notifications = { + plans = ["lite", "standard"], + } +} + +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_en_subscription_webhook" "subscription_webhook_lite" { + instance_guid = ibm_resource_instance.event_notifications["lite"].guid + name = "Webhook Subscription" + description = "Webhook Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_webhook" "subscription_webhook_standard" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Webhook Subscription" + description = "Webhook Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} + +resource "ibm_en_subscription_webhook" "subscription_webhook_standard_no_usage" { + instance_guid = ibm_resource_instance.event_notifications["standard"].guid + name = "Webhook Subscription" + description = "Webhook Subscription for Event Notifications" + destination_id = "somedestinationid" + topic_id = "sometopicid" +} diff --git a/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.usage.yml b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.usage.yml new file mode 100644 index 00000000000..2541d2023bb --- /dev/null +++ b/internal/providers/terraform/ibm/testdata/en_subscription_webhook_test/en_subscription_webhook_test.usage.yml @@ -0,0 +1,6 @@ +version: 0.1 +resource_usage: + ibm_en_subscription_webhook.subscription_webhook_lite: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 + ibm_en_subscription_webhook.subscription_webhook_standard: + event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP: 1000000 diff --git a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden index d92343b38f2..f6cc53cdc8d 100644 --- a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden +++ b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.golden @@ -18,6 +18,15 @@ └─ 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.event_notifications["lite"] + └─ Lite Plan 1 Instance $0.00 + + ibm_resource_instance.event_notifications["standard"] + └─ Ingested Events 1 Million Events $1.08 + + ibm_resource_instance.event_notifications_no_usage + └─ Ingested Events Monthly cost depends on usage: $1.08 per Million Events + ibm_resource_instance.messagehub_enterprise ├─ Base Capacity Unit-Hour 1 Hours $7.37 ├─ Additional Capacity Unit-Hour 1 Hours $7.37 @@ -197,7 +206,7 @@ ├─ Class 2 Resource Units 50 RU $0.09 └─ Class 3 Resource Units 50 RU $0.25 - OVERALL TOTAL $19,305.11 + OVERALL TOTAL $19,306.19 ────────────────────────────────── -41 cloud resources were detected: -∙ 41 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file +44 cloud resources were detected: +∙ 44 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf index 3d96aabb015..3c91f28f23d 100644 --- a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf +++ b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf @@ -328,3 +328,25 @@ resource "ibm_resource_instance" "messagehub_satellite" { location = "satcon_dal" resource_group_id = "default" } + +locals { + event_notifications = { + plans : ["lite", "standard"] + } +} +resource "ibm_resource_instance" "event_notifications" { + for_each = toset(local.event_notifications.plans) + name = "event-notifications-${each.value}" + location = "us-south" + plan = each.value + resource_group_id = "default" + service = "event-notifications" +} + +resource "ibm_resource_instance" "event_notifications_no_usage" { + name = "event-notifications-standard-no-usage" + location = "us-south" + plan = "standard" + resource_group_id = "default" + service = "event-notifications" +} diff --git a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.usage.yml b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.usage.yml index 0d207b793a2..a68b43c8717 100644 --- a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.usage.yml +++ b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.usage.yml @@ -114,7 +114,7 @@ resource_usage: messagehub_CAPACITY_UNIT_HOURS: 1 messagehub_qty_capacity_units: 1 messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1 - messagehub_qty_capacity_units_additional: 1 + messagehub_qty_capacity_units_additional: 1 messagehub_CAPACITY_UNIT_HOURS_MIRRORING: 1 messagehub_qty_capacity_units_mirroring: 1 messagehub_INSTANCE_HOURS: 1 @@ -127,12 +127,12 @@ resource_usage: messagehub_INSTANCE_HOURS: 100 messagehub_qty_instances: 1 messagehub_GIGABYTE_TRANSMITTED_OUTBOUNDS: 100 - + ibm_resource_instance.messagehub_enterprise: messagehub_CAPACITY_UNIT_HOURS: 1 messagehub_qty_capacity_units: 1 messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1 - messagehub_qty_capacity_units_additional: 1 + messagehub_qty_capacity_units_additional: 1 messagehub_CAPACITY_UNIT_HOURS_MIRRORING: 1 messagehub_qty_capacity_units_mirroring: 1 messagehub_TERABYTE_HOURS: 10 @@ -143,4 +143,7 @@ resource_usage: messagehub_CAPACITY_UNIT_HOURS: 1 messagehub_qty_capacity_units: 1 messagehub_CAPACITY_UNIT_HOURS_ADDITIONAL: 1 - messagehub_qty_capacity_units_additional: 1 + messagehub_qty_capacity_units_additional: 1 + + ibm_resource_instance.event_notifications[*]: + event-notifications_MILLION_INGESTED_EVENTS: 1 \ No newline at end of file diff --git a/internal/resources/ibm/en_destination.go b/internal/resources/ibm/en_destination.go new file mode 100644 index 00000000000..04c410b0c15 --- /dev/null +++ b/internal/resources/ibm/en_destination.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestination struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestination struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationUsageSchema defines a list which represents the usage schema of EnDestination. +var EnDestinationUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestination. +// It uses the `infracost_usage` struct tags to populate data into the EnDestination. +func (r *EnDestination) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestination struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestination) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationAndroidPushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationAndroidPushDestinationInstancesCostComponent(r *EnDestination) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_destination_chrome.go b/internal/resources/ibm/en_destination_chrome.go new file mode 100644 index 00000000000..24a883d5a4b --- /dev/null +++ b/internal/resources/ibm/en_destination_chrome.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestinationChrome struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestinationChrome struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationChromeUsageSchema defines a list which represents the usage schema of EnDestinationChrome. +var EnDestinationChromeUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestinationChrome. +// It uses the `infracost_usage` struct tags to populate data into the EnDestinationChrome. +func (r *EnDestinationChrome) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestinationChrome struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestinationChrome) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationChromePushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationChromeUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationChromePushDestinationInstancesCostComponent(r *EnDestinationChrome) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_destination_firefox.go b/internal/resources/ibm/en_destination_firefox.go new file mode 100644 index 00000000000..f3bdf208285 --- /dev/null +++ b/internal/resources/ibm/en_destination_firefox.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestinationFirefox struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestinationFirefox struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationFirefoxUsageSchema defines a list which represents the usage schema of EnDestinationFirefox. +var EnDestinationFirefoxUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestinationFirefox. +// It uses the `infracost_usage` struct tags to populate data into the EnDestinationFirefox. +func (r *EnDestinationFirefox) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestinationFirefox struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestinationFirefox) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationFirefoxPushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationFirefoxUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationFirefoxPushDestinationInstancesCostComponent(r *EnDestinationFirefox) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_destination_huawei.go b/internal/resources/ibm/en_destination_huawei.go new file mode 100644 index 00000000000..7bef7b8c5d0 --- /dev/null +++ b/internal/resources/ibm/en_destination_huawei.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestinationHuawei struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestinationHuawei struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationHuaweiUsageSchema defines a list which represents the usage schema of EnDestinationHuawei. +var EnDestinationHuaweiUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestinationHuawei. +// It uses the `infracost_usage` struct tags to populate data into the EnDestinationHuawei. +func (r *EnDestinationHuawei) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestinationHuawei struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestinationHuawei) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationHuaweiPushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationHuaweiUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationHuaweiPushDestinationInstancesCostComponent(r *EnDestinationHuawei) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_destination_iphoneos.go b/internal/resources/ibm/en_destination_iphoneos.go new file mode 100644 index 00000000000..4df39965a3a --- /dev/null +++ b/internal/resources/ibm/en_destination_iphoneos.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestinationIphoneos struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestinationIphoneos struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationIphoneosUsageSchema defines a list which represents the usage schema of EnDestinationIphoneos. +var EnDestinationIphoneosUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestinationIphoneos. +// It uses the `infracost_usage` struct tags to populate data into the EnDestinationIphoneos. +func (r *EnDestinationIphoneos) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestinationIphoneos struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestinationIphoneos) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationiOSPushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationIphoneosUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationiOSPushDestinationInstancesCostComponent(r *EnDestinationIphoneos) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_destination_safari.go b/internal/resources/ibm/en_destination_safari.go new file mode 100644 index 00000000000..4df9050e557 --- /dev/null +++ b/internal/resources/ibm/en_destination_safari.go @@ -0,0 +1,109 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnDestinationSafari struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnDestinationSafari struct { + Address string + IsPreProd bool + Name string + Plan string + Region string +} + +// EnDestinationSafariUsageSchema defines a list which represents the usage schema of EnDestinationSafari. +var EnDestinationSafariUsageSchema = []*schema.UsageItem{} + +// PopulateUsage parses the u schema.UsageData into the EnDestinationSafari. +// It uses the `infracost_usage` struct tags to populate data into the EnDestinationSafari. +func (r *EnDestinationSafari) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnDestinationSafari struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnDestinationSafari) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnDestinationSafariPushDestinationInstancesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnDestinationSafariUsageSchema, + CostComponents: costComponents, + } +} + +func EnDestinationSafariPushDestinationInstancesCostComponent(r *EnDestinationSafari) *schema.CostComponent { + + var costComponent schema.CostComponent + component_name := "Push Destination Instances" + unit := "PUSH_DESTINATION_INSTANCES" + + if r.IsPreProd { + component_name = "Pre-Prod Push Destination Instances" + unit = "PUSH_PREPROD_DESTINATION_INSTANCES" + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ // Only standard plan exists + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr(unit), + }, + } + + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription.go b/internal/resources/ibm/en_subscription.go new file mode 100644 index 00000000000..ebe360181d2 --- /dev/null +++ b/internal/resources/ibm/en_subscription.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscription struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscription struct { + Address string + Name string + Plan string + Region string + EnSubscriptionAndroid_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionUsageSchema defines a list which represents the usage schema of EnSubscription. +var EnSubscriptionUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscription. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscription. +func (r *EnSubscription) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscription struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscription) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionAndroidOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionAndroidOutboundPushMessagesCostComponent(r *EnSubscription) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Android Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionAndroid_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionAndroid_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionAndroid_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_ce.go b/internal/resources/ibm/en_subscription_ce.go new file mode 100644 index 00000000000..0b5c483b461 --- /dev/null +++ b/internal/resources/ibm/en_subscription_ce.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionCe struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionCe struct { + Address string + Region string + Name string + Plan string + EnSubscriptionCodeEngine_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionCeUsageSchema defines a list which represents the usage schema of EnSubscriptionCe. +var EnSubscriptionCeUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionCe. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionCe. +func (r *EnSubscriptionCe) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionCe struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionCe) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionCodeEngineOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionCeUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionCodeEngineOutboundHTTPMessagesCostComponent(r *EnSubscriptionCe) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Code Engine HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionCodeEngine_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionCodeEngine_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_chrome.go b/internal/resources/ibm/en_subscription_chrome.go new file mode 100644 index 00000000000..aea6b165071 --- /dev/null +++ b/internal/resources/ibm/en_subscription_chrome.go @@ -0,0 +1,114 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionChrome struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionChrome struct { + Address string + Region string + Name string + Plan string + EnSubscriptionChrome_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionChromeUsageSchema defines a list which represents the usage schema of EnSubscriptionChrome. +var EnSubscriptionChromeUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionChrome. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionChrome. +func (r *EnSubscriptionChrome) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionChrome struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionChrome) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionChromeOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionChromeUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionChromeOutboundPushMessagesCostComponent(r *EnSubscriptionChrome) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Chrome Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionChrome_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionChrome_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionChrome_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_cos.go b/internal/resources/ibm/en_subscription_cos.go new file mode 100644 index 00000000000..4c2087f3d3e --- /dev/null +++ b/internal/resources/ibm/en_subscription_cos.go @@ -0,0 +1,112 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionCos struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionCos struct { + Address string + Region string + Name string + Plan string + EnSubscriptionCOS_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionCosUsageSchema defines a list which represents the usage schema of EnSubscriptionCos. +var EnSubscriptionCosUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionCos. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionCos. +func (r *EnSubscriptionCos) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionCos struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionCos) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionCOSOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionCosUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionCOSOutboundHTTPMessagesCostComponent(r *EnSubscriptionCos) *schema.CostComponent { + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Cloud Object Storage HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionCOS_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionCOS_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_custom_email.go b/internal/resources/ibm/en_subscription_custom_email.go new file mode 100644 index 00000000000..c70e2589635 --- /dev/null +++ b/internal/resources/ibm/en_subscription_custom_email.go @@ -0,0 +1,185 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionCustomEmail struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionCustomEmail struct { + Address string + Region string + Name string + Plan string + EnSubscriptionEmail_OutboundCustomDomainEmailMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL"` + EnSubscriptionEmail_OutboundTransmittedGB *float64 `infracost_usage:"event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL"` +} + +// EnSubscriptionCustomEmailUsageSchema defines a list which represents the usage schema of EnSubscriptionCustomEmail. +var EnSubscriptionCustomEmailUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL", DefaultValue: 0, ValueType: schema.Int64}, + {Key: "event-notifications_GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionCustomEmail. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionCustomEmail. +func (r *EnSubscriptionCustomEmail) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionCustomEmail struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionCustomEmail) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionEmailOutboundCustomDomainEmailMessagesCostComponent(r), + EnSubscriptionEmail_OutboundTransmittedGBCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionCustomEmailUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionEmailOutboundCustomDomainEmailMessagesCostComponent(r *EnSubscriptionCustomEmail) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Custom Domain E-mail Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity = decimalPtr(decimal.NewFromFloat(math.Min(float64(*r.EnSubscriptionEmail_OutboundCustomDomainEmailMessages), float64(20)))) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 20)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + if r.EnSubscriptionEmail_OutboundCustomDomainEmailMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionEmail_OutboundCustomDomainEmailMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGE_CUSTOM_DOMAIN_EMAIL"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} + +func EnSubscriptionEmail_OutboundTransmittedGBCostComponent(r *EnSubscriptionCustomEmail) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Transmitted E-mail Messages" + component_unit := "GB" + + if r.EnSubscriptionEmail_OutboundTransmittedGB != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EnSubscriptionEmail_OutboundTransmittedGB)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("GIGABYTE_TRANSMITTED_OUTBOUND_CUSTOM_DOMAIN_EMAIL"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_email.go b/internal/resources/ibm/en_subscription_email.go new file mode 100644 index 00000000000..84c2153892d --- /dev/null +++ b/internal/resources/ibm/en_subscription_email.go @@ -0,0 +1,116 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionEmail struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionEmail struct { + Address string + Region string + Name string + Plan string + EnSubscriptionEmail_OutboundEmailMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS"` +} + +// EnSubscriptionEmailUsageSchema defines a list which represents the usage schema of EnSubscriptionEmail. +var EnSubscriptionEmailUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_EMAILS", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionEmail. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionEmail. +func (r *EnSubscriptionEmail) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionEmail struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionEmail) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionEmailOutboundMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionEmailUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionEmailOutboundMessagesCostComponent(r *EnSubscriptionEmail) *schema.CostComponent { + + var costComponent schema.CostComponent + + component_name := "Outbound E-mail Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := decimalPtr(decimal.NewFromFloat(math.Min(float64(*r.EnSubscriptionEmail_OutboundEmailMessages), float64(20)))) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 20)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionEmail_OutboundEmailMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionEmail_OutboundEmailMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_EMAILS"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_firefox.go b/internal/resources/ibm/en_subscription_firefox.go new file mode 100644 index 00000000000..459d8470093 --- /dev/null +++ b/internal/resources/ibm/en_subscription_firefox.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionFirefox struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionFirefox struct { + Address string + Region string + Name string + Plan string + EnSubscriptionFirefox_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionFirefoxUsageSchema defines a list which represents the usage schema of EnSubscriptionFirefox. +var EnSubscriptionFirefoxUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionFirefox. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionFirefox. +func (r *EnSubscriptionFirefox) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionFirefox struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionFirefox) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionFirefoxOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionFirefoxUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionFirefoxOutboundPushMessagesCostComponent(r *EnSubscriptionFirefox) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Firefox Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionFirefox_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionFirefox_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionFirefox_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_huawei.go b/internal/resources/ibm/en_subscription_huawei.go new file mode 100644 index 00000000000..de16689a5cd --- /dev/null +++ b/internal/resources/ibm/en_subscription_huawei.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionHuawei struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionHuawei struct { + Address string + Region string + Name string + Plan string + EnSubscriptionHuawei_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionHuaweiUsageSchema defines a list which represents the usage schema of EnSubscriptionHuawei. +var EnSubscriptionHuaweiUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionHuawei. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionHuawei. +func (r *EnSubscriptionHuawei) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionHuawei struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionHuawei) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionHuaweiOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionHuaweiUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionHuaweiOutboundPushMessagesCostComponent(r *EnSubscriptionHuawei) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Huawei Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionHuawei_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionHuawei_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionHuawei_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_iphoneos.go b/internal/resources/ibm/en_subscription_iphoneos.go new file mode 100644 index 00000000000..c99eab79a39 --- /dev/null +++ b/internal/resources/ibm/en_subscription_iphoneos.go @@ -0,0 +1,114 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionIphoneos struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionIphoneos struct { + Address string + Region string + Name string + Plan string + EnSubscriptioniOS_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionIphoneosUsageSchema defines a list which represents the usage schema of EnSubscriptionIphoneos. +var EnSubscriptionIphoneosUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionIphoneos. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionIphoneos. +func (r *EnSubscriptionIphoneos) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionIphoneos struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionIphoneos) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptioniOSOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionIphoneosUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptioniOSOutboundPushMessagesCostComponent(r *EnSubscriptionIphoneos) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound iOS Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptioniOS_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptioniOS_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptioniOS_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_msteams.go b/internal/resources/ibm/en_subscription_msteams.go new file mode 100644 index 00000000000..0b33e936aba --- /dev/null +++ b/internal/resources/ibm/en_subscription_msteams.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionMsteams struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionMsteams struct { + Address string + Region string + Name string + Plan string + EnSubscriptionMsteams_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionMsteamsUsageSchema defines a list which represents the usage schema of EnSubscriptionMsteams. +var EnSubscriptionMsteamsUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionMsteams. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionMsteams. +func (r *EnSubscriptionMsteams) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionMsteams struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionMsteams) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionMsteamsOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionMsteamsUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionMsteamsOutboundHTTPMessagesCostComponent(r *EnSubscriptionMsteams) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Microsoft Teams HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionMsteams_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionMsteams_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_pagerduty.go b/internal/resources/ibm/en_subscription_pagerduty.go new file mode 100644 index 00000000000..f8131172a82 --- /dev/null +++ b/internal/resources/ibm/en_subscription_pagerduty.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionPagerduty struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionPagerduty struct { + Address string + Region string + Name string + Plan string + EnSubscriptionPagerDuty_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionPagerdutyUsageSchema defines a list which represents the usage schema of EnSubscriptionPagerduty. +var EnSubscriptionPagerdutyUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionPagerduty. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionPagerduty. +func (r *EnSubscriptionPagerduty) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionPagerduty struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionPagerduty) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionPagerDutyOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionPagerdutyUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionPagerDutyOutboundHTTPMessagesCostComponent(r *EnSubscriptionPagerduty) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound PagerDuty HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionPagerDuty_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionPagerDuty_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_safari.go b/internal/resources/ibm/en_subscription_safari.go new file mode 100644 index 00000000000..a563ae90845 --- /dev/null +++ b/internal/resources/ibm/en_subscription_safari.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionSafari struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionSafari struct { + Address string + Region string + Name string + Plan string + EnSubscriptionSafari_OutboundPushMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH"` +} + +// EnSubscriptionSafariUsageSchema defines a list which represents the usage schema of EnSubscriptionSafari. +var EnSubscriptionSafariUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_PUSH", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionSafari. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionSafari. +func (r *EnSubscriptionSafari) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionSafari struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionSafari) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionSafariOutboundPushMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionSafariUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionSafariOutboundPushMessagesCostComponent(r *EnSubscriptionSafari) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Safari Push Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionSafari_OutboundPushMessages), float64(1000)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 1,000 per destination)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionSafari_OutboundPushMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionSafari_OutboundPushMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_PUSH"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_slack.go b/internal/resources/ibm/en_subscription_slack.go new file mode 100644 index 00000000000..9566e952093 --- /dev/null +++ b/internal/resources/ibm/en_subscription_slack.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionSlack struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionSlack struct { + Address string + Region string + Name string + Plan string + EnSubscriptionSlack_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionSlackUsageSchema defines a list which represents the usage schema of EnSubscriptionSlack. +var EnSubscriptionSlackUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionSlack. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionSlack. +func (r *EnSubscriptionSlack) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionSlack struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionSlack) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionSlackOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionSlackUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionSlackOutboundHTTPMessagesCostComponent(r *EnSubscriptionSlack) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound Slack HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionSlack_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionSlack_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_sms.go b/internal/resources/ibm/en_subscription_sms.go new file mode 100644 index 00000000000..3cf8e3f1151 --- /dev/null +++ b/internal/resources/ibm/en_subscription_sms.go @@ -0,0 +1,247 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionSms struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionSms struct { + Address string + Region string + Name string + Plan string + EnSubscriptionSMS_NumberResourceUnits *float64 `infracost_usage:"event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY"` + EnSubscriptionSMS_NumberSetupResourceUnits *float64 `infracost_usage:"event-notifications_RESOURCE_UNITS_NUMBER_SETUP"` + EnSubscriptionSMS_OutboundMessageUnits *float64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS"` +} + +// EnSubscriptionSmsUsageSchema defines a list which represents the usage schema of EnSubscriptionSms. +var EnSubscriptionSmsUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS", DefaultValue: 0, ValueType: schema.Float64}, + {Key: "event-notifications_RESOURCE_UNITS_NUMBER_SETUP", DefaultValue: 0, ValueType: schema.Float64}, + {Key: "event-notifications_RESOURCE_UNITS_NUMBER_MONTHLY", DefaultValue: 0, ValueType: schema.Float64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionSms. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionSms. +func (r *EnSubscriptionSms) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionSms struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionSms) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionSMSOutboundSMSMessageUnitsCostComponent(r), + EnSubscriptionSMSNumberSetupResourceUnitsCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionSmsUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionSMSNumberSetupResourceUnitsCostComponent(r *EnSubscriptionSms) *schema.CostComponent { + + component_unit := "Resource Units" + component_name := "SMS Number Setup Resource Units" + + var costComponent schema.CostComponent + + if r.Plan == "lite" { + + var quantity *decimal.Decimal + if r.EnSubscriptionSMS_NumberSetupResourceUnits != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EnSubscriptionSMS_NumberSetupResourceUnits)) + } else { + quantity = decimalPtr(decimal.NewFromInt(1)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: strPtr("standard")}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("RESOURCE_UNITS_NUMBER_SETUP"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionSMS_NumberSetupResourceUnits != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EnSubscriptionSMS_NumberSetupResourceUnits)) + } else { + quantity = decimalPtr(decimal.NewFromInt(1)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (One-time Fee) (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("RESOURCE_UNITS_NUMBER_SETUP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent +} + +func EnSubscriptionSMSNumberResourceUnitsCostComponent(r *EnSubscriptionSms) *schema.CostComponent { + + var costComponent schema.CostComponent + + if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionSMS_NumberSetupResourceUnits != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EnSubscriptionSMS_NumberSetupResourceUnits)) + } + + costComponent = schema.CostComponent{ + Name: "SMS Number Use Resource Units", + Unit: "Resource Units", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("RESOURCE_UNITS_NUMBER_MONTHLY"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + return &costComponent + +} + +func EnSubscriptionSMSOutboundSMSMessageUnitsCostComponent(r *EnSubscriptionSms) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound IBM Cloud SMS Message Units" + component_unit := "Message Units" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionSMS_OutboundMessageUnits), float64(20)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 20)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionSMS_OutboundMessageUnits != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EnSubscriptionSMS_OutboundMessageUnits)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_SMS_UNITS"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_sn.go b/internal/resources/ibm/en_subscription_sn.go new file mode 100644 index 00000000000..34e677e15ac --- /dev/null +++ b/internal/resources/ibm/en_subscription_sn.go @@ -0,0 +1,113 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionSn struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionSn struct { + Address string + Region string + Name string + Plan string + EnSubscriptionServiceNow_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionSnUsageSchema defines a list which represents the usage schema of EnSubscriptionSn. +var EnSubscriptionSnUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionSn. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionSn. +func (r *EnSubscriptionSn) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionSn struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionSn) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionServiceNowOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionSnUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionServiceNowOutboundHTTPMessagesCostComponent(r *EnSubscriptionSn) *schema.CostComponent { + + var costComponent schema.CostComponent + var quantity *decimal.Decimal + + component_name := "Outbound ServiceNow HTTP Messages" + component_unit := "Messages" + + if r.EnSubscriptionServiceNow_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionServiceNow_OutboundHTTPMessages)) + } + + if r.Plan == "lite" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/en_subscription_webhook.go b/internal/resources/ibm/en_subscription_webhook.go new file mode 100644 index 00000000000..821d7c9184c --- /dev/null +++ b/internal/resources/ibm/en_subscription_webhook.go @@ -0,0 +1,114 @@ +package ibm + +import ( + "fmt" + "math" + + "github.com/infracost/infracost/internal/resources" + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +// EnSubscriptionWebhook struct +// +// Resource information: https://cloud.ibm.com/catalog/services/event-notifications#about +// Pricing information: https://cloud.ibm.com/catalog/services/event-notifications +type EnSubscriptionWebhook struct { + Address string + Region string + Name string + Plan string + EnSubscriptionWebhook_OutboundHTTPMessages *int64 `infracost_usage:"event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP"` +} + +// EnSubscriptionWebhookUsageSchema defines a list which represents the usage schema of EnSubscriptionWebhook. +var EnSubscriptionWebhookUsageSchema = []*schema.UsageItem{ + {Key: "event-notifications_OUTBOUND_DIGITAL_MESSAGES_HTTP", DefaultValue: 0, ValueType: schema.Int64}, +} + +// PopulateUsage parses the u schema.UsageData into the EnSubscriptionWebhook. +// It uses the `infracost_usage` struct tags to populate data into the EnSubscriptionWebhook. +func (r *EnSubscriptionWebhook) PopulateUsage(u *schema.UsageData) { + resources.PopulateArgsWithUsage(r, u) +} + +// BuildResource builds a schema.Resource from a valid EnSubscriptionWebhook struct. +// This method is called after the resource is initialised by an IaC provider. +// See providers folder for more information. +func (r *EnSubscriptionWebhook) BuildResource() *schema.Resource { + costComponents := []*schema.CostComponent{ + EnSubscriptionWebhookOutboundHTTPMessagesCostComponent(r), + } + + return &schema.Resource{ + Name: r.Address, + UsageSchema: EnSubscriptionWebhookUsageSchema, + CostComponents: costComponents, + } +} + +func EnSubscriptionWebhookOutboundHTTPMessagesCostComponent(r *EnSubscriptionWebhook) *schema.CostComponent { + var costComponent schema.CostComponent + component_name := "Outbound Webhook HTTP Messages" + component_unit := "Messages" + + if r.Plan == "lite" { + + quantity := math.Min(float64(*r.EnSubscriptionWebhook_OutboundHTTPMessages), float64(20)) + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Lite plan) (Max. 20)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromFloat(quantity)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + + } else if r.Plan == "standard" { + + var quantity *decimal.Decimal + if r.EnSubscriptionWebhook_OutboundHTTPMessages != nil { + quantity = decimalPtr(decimal.NewFromInt(*r.EnSubscriptionWebhook_OutboundHTTPMessages)) + } + + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("%s (Standard plan)", component_name), + Unit: component_unit, + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: quantity, + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("OUTBOUND_DIGITAL_MESSAGES_HTTP"), + }, + } + } else { + costComponent = schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Region), + Service: strPtr("event-notifications"), + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + } + + return &costComponent +} diff --git a/internal/resources/ibm/resource_instance.go b/internal/resources/ibm/resource_instance.go index 87676fdbb8f..ffa36d732eb 100644 --- a/internal/resources/ibm/resource_instance.go +++ b/internal/resources/ibm/resource_instance.go @@ -108,6 +108,8 @@ type ResourceInstance struct { EventStreams_Instances *float64 `infracost_usage:"messagehub_qty_instances"` EventStreams_TerabyteHours *float64 `infracost_usage:"messagehub_TERABYTE_HOURS"` EventStreams_Terabytes *float64 `infracost_usage:"messagehub_qty_terabytes"` + // Event Notifications + EventNotifications_InboundIngestedEvents *float64 `infracost_usage:"event-notifications_MILLION_INGESTED_EVENTS"` } type ResourceCostComponentsFunc func(*ResourceInstance) []*schema.CostComponent @@ -177,27 +179,29 @@ var ResourceInstanceUsageSchema = []*schema.UsageItem{ {Key: "messagehub_qty_instances", DefaultValue: 1, ValueType: schema.Float64}, {Key: "messagehub_TERABYTE_HOURS", DefaultValue: 1, ValueType: schema.Float64}, {Key: "messagehub_qty_terabytes", DefaultValue: 1, ValueType: schema.Float64}, + {Key: "event-notifications_MILLION_INGESTED_EVENTS", DefaultValue: 0, ValueType: schema.Float64}, } var ResourceInstanceCostMap map[string]ResourceCostComponentsFunc = map[string]ResourceCostComponentsFunc{ - "kms": GetKMSCostComponents, - "secrets-manager": GetSecretsManagerCostComponents, - "appid": GetAppIDCostComponents, + "aiopenscale": GetWGOVCostComponents, "appconnect": GetAppConnectCostComponents, - "power-iaas": GetPowerCostComponents, - "logdna": GetLogDNACostComponents, - "logdnaat": GetActivityTrackerCostComponents, - "sysdig-monitor": GetSysdigCostComponenets, + "appid": GetAppIDCostComponents, + "compliance": GetSCCCostComponents, "continuous-delivery": GetContinuousDeliveryCostComponenets, - "pm-20": GetWMLCostComponents, "conversation": GetWACostComponents, - "discovery": GetWDCostComponents, - "compliance": GetSCCCostComponents, "data-science-experience": GetWSCostComponents, - "sysdig-secure": GetSCCWPCostComponents, - "aiopenscale": GetWGOVCostComponents, + "discovery": GetWDCostComponents, "dns-svcs": GetDNSServicesCostComponents, + "event-notifications": GetEventNotificationsCostComponents, + "kms": GetKMSCostComponents, + "logdna": GetLogDNACostComponents, + "logdnaat": GetActivityTrackerCostComponents, "messagehub": GetEventStreamsCostComponents, + "pm-20": GetWMLCostComponents, + "power-iaas": GetPowerCostComponents, + "secrets-manager": GetSecretsManagerCostComponents, + "sysdig-monitor": GetSysdigCostComponenets, + "sysdig-secure": GetSCCWPCostComponents, } func KMSKeyVersionsFreeCostComponent(r *ResourceInstance) *schema.CostComponent { @@ -674,6 +678,7 @@ func GetContinuousDeliveryCostComponenets(r *ResourceInstance) []*schema.CostCom q = decimalPtr(decimal.NewFromInt(*r.ContinuousDelivery_AuthorizedUsers)) } if r.Plan == "lite" { + costComponent := &schema.CostComponent{ Name: "Lite plan", UnitMultiplier: decimal.NewFromInt(1), diff --git a/internal/resources/ibm/resource_instance_event-notifications.go b/internal/resources/ibm/resource_instance_event-notifications.go new file mode 100644 index 00000000000..960e3b29209 --- /dev/null +++ b/internal/resources/ibm/resource_instance_event-notifications.go @@ -0,0 +1,83 @@ +package ibm + +import ( + "fmt" + + "github.com/infracost/infracost/internal/schema" + "github.com/shopspring/decimal" +) + +const EVENT_NOTIFICATIONS_LITE_PLAN_PROGRAMMATIC_NAME = "lite" +const EVENT_NOTIFICATIONS_STANDARD_PLAN_PROGRAMMATIC_NAME = "standard" + +func GetEventNotificationsCostComponents(r *ResourceInstance) []*schema.CostComponent { + if r.Plan == EVENT_NOTIFICATIONS_LITE_PLAN_PROGRAMMATIC_NAME { + costComponent := schema.CostComponent{ + Name: "Lite Plan", + Unit: "Instance", + UnitMultiplier: decimal.NewFromInt(1), + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + return []*schema.CostComponent{ + &costComponent, + } + } else if r.Plan == EVENT_NOTIFICATIONS_STANDARD_PLAN_PROGRAMMATIC_NAME { + return []*schema.CostComponent{ + EventNotificationsInboundIngestedEventsCostComponent(r), + } + } else { + costComponent := schema.CostComponent{ + Name: fmt.Sprintf("Plan %s not found", r.Plan), + UnitMultiplier: decimal.NewFromInt(1), // Final quantity for this cost component will be divided by this amount + MonthlyQuantity: decimalPtr(decimal.NewFromInt(1)), + ProductFilter: &schema.ProductFilter{ + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + } + costComponent.SetCustomPrice(decimalPtr(decimal.NewFromInt(0))) + return []*schema.CostComponent{ + &costComponent, + } + } +} + +func EventNotificationsInboundIngestedEventsCostComponent(r *ResourceInstance) *schema.CostComponent { + + var quantity *decimal.Decimal + if r.EventNotifications_InboundIngestedEvents != nil { + quantity = decimalPtr(decimal.NewFromFloat(*r.EventNotifications_InboundIngestedEvents)) + } + + costComponent := schema.CostComponent{ + Name: "Ingested Events", // Short descriptive name of the component. + Unit: "Million Events", // Unit of resource component's measurement. For example, it can be hours or 10M requests. + UnitMultiplier: decimal.NewFromInt(1), // Used to calculate the cost of component quantity correctly. For example, if a price is $0.02 per 1k requests, and assuming the amount is 10,000, its cost will be calculated as quantity/unitMultiplier * price. + MonthlyQuantity: quantity, // HourlyQuantity or MonthlyQuantity attributes specify the quantity of the resource. If the measurement unit is GB, it will be the number of gigabytes. If the unit is hours, it can be 1 as "1 hour" + ProductFilter: &schema.ProductFilter{ // Helps identify the exact price of the "product." Usually, it's only one, but if there are pricing tiers, its filters can pick the correct value. + VendorName: strPtr("ibm"), + Region: strPtr(r.Location), + Service: &r.Service, + AttributeFilters: []*schema.AttributeFilter{ + {Key: "planName", Value: &r.Plan}, + }, + }, + PriceFilter: &schema.PriceFilter{ + Unit: strPtr("MILLION_INGESTED_EVENTS"), + }, + } + return &costComponent +}