cdk-cost-analyzer 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.cdk-cost-analyzer-cache/metadata.json +8 -8
  2. package/README.md +92 -42
  3. package/dist/action/config/types.d.ts +74 -0
  4. package/dist/action/index.js +3 -3
  5. package/dist/action/pricing/calculators/AppRunnerCalculator.d.ts +24 -0
  6. package/dist/action/pricing/calculators/AthenaCalculator.d.ts +50 -0
  7. package/dist/action/pricing/calculators/BatchCalculator.d.ts +14 -0
  8. package/dist/action/pricing/calculators/DocumentDBCalculator.d.ts +8 -0
  9. package/dist/action/pricing/calculators/FSxCalculator.d.ts +8 -0
  10. package/dist/action/pricing/calculators/GlueCalculator.d.ts +26 -0
  11. package/dist/action/pricing/calculators/NeptuneCalculator.d.ts +8 -0
  12. package/dist/action/pricing/calculators/SageMakerCalculator.d.ts +12 -0
  13. package/dist/action/pricing/calculators/WAFCalculator.d.ts +51 -0
  14. package/dist/action/pricing/calculators/internal/databaseInstanceCost.d.ts +18 -0
  15. package/dist/config/types.d.ts +74 -0
  16. package/dist/config/types.js +1 -1
  17. package/dist/pricing/PricingService.js +19 -1
  18. package/dist/pricing/calculators/AppRunnerCalculator.d.ts +24 -0
  19. package/dist/pricing/calculators/AppRunnerCalculator.js +97 -0
  20. package/dist/pricing/calculators/AthenaCalculator.d.ts +50 -0
  21. package/dist/pricing/calculators/AthenaCalculator.js +87 -0
  22. package/dist/pricing/calculators/BatchCalculator.d.ts +14 -0
  23. package/dist/pricing/calculators/BatchCalculator.js +80 -0
  24. package/dist/pricing/calculators/DocumentDBCalculator.d.ts +8 -0
  25. package/dist/pricing/calculators/DocumentDBCalculator.js +37 -0
  26. package/dist/pricing/calculators/FSxCalculator.d.ts +8 -0
  27. package/dist/pricing/calculators/FSxCalculator.js +52 -0
  28. package/dist/pricing/calculators/GlueCalculator.d.ts +26 -0
  29. package/dist/pricing/calculators/GlueCalculator.js +89 -0
  30. package/dist/pricing/calculators/NeptuneCalculator.d.ts +8 -0
  31. package/dist/pricing/calculators/NeptuneCalculator.js +37 -0
  32. package/dist/pricing/calculators/SageMakerCalculator.d.ts +12 -0
  33. package/dist/pricing/calculators/SageMakerCalculator.js +71 -0
  34. package/dist/pricing/calculators/WAFCalculator.d.ts +51 -0
  35. package/dist/pricing/calculators/WAFCalculator.js +84 -0
  36. package/dist/pricing/calculators/internal/databaseInstanceCost.d.ts +18 -0
  37. package/dist/pricing/calculators/internal/databaseInstanceCost.js +67 -0
  38. package/dist/releasetag.txt +1 -1
  39. package/docs/CALCULATORS.md +461 -4
  40. package/package.json +1 -1
@@ -2,35 +2,35 @@
2
2
  "entries": {
3
3
  "AmazonS3:US East (N. Virginia):storageClass:General Purpose|volumeType:Standard": {
4
4
  "price": 0.023,
5
- "timestamp": 1780078952090
5
+ "timestamp": 1780084662489
6
6
  },
7
7
  "AmazonDynamoDB:US East (N. Virginia):group:DDB-ReadUnits|productFamily:Amazon DynamoDB PayPerRequest Throughput": {
8
8
  "price": 0.023,
9
- "timestamp": 1780078952103
9
+ "timestamp": 1780084662501
10
10
  },
11
11
  "AmazonDynamoDB:US East (N. Virginia):group:DDB-WriteUnits|productFamily:Amazon DynamoDB PayPerRequest Throughput": {
12
12
  "price": 0.023,
13
- "timestamp": 1780078952103
13
+ "timestamp": 1780084662501
14
14
  },
15
15
  "AmazonEC2:US East (N. Virginia):capacitystatus:Used|instanceType:t3.micro|operatingSystem:Linux|preInstalledSw:NA|tenancy:Shared": {
16
16
  "price": 0.023,
17
- "timestamp": 1780078952113
17
+ "timestamp": 1780084662512
18
18
  },
19
19
  "AWSLambda:US East (N. Virginia):group:AWS-Lambda-Requests": {
20
20
  "price": 0.023,
21
- "timestamp": 1780078952124
21
+ "timestamp": 1780084662521
22
22
  },
23
23
  "AWSLambda:US East (N. Virginia):group:AWS-Lambda-Duration": {
24
24
  "price": 0.023,
25
- "timestamp": 1780078952124
25
+ "timestamp": 1780084662522
26
26
  },
27
27
  "AmazonS3:EU (Frankfurt):storageClass:General Purpose|volumeType:Standard": {
28
28
  "price": 0.023,
29
- "timestamp": 1780078962069
29
+ "timestamp": 1780084671568
30
30
  },
31
31
  "AmazonS3:invalid-region-123:storageClass:General Purpose|volumeType:Standard": {
32
32
  "price": 0.023,
33
- "timestamp": 1780078962114
33
+ "timestamp": 1780084671610
34
34
  }
35
35
  }
36
36
  }
package/README.md CHANGED
@@ -522,59 +522,109 @@ Environment variables for GitHub integration:
522
522
 
523
523
  ## Supported Resource Types
524
524
 
525
- ### Core Resources (Phase 1 & 2)
525
+ See [docs/CALCULATORS.md](docs/CALCULATORS.md) for the full per-resource reference, including pricing model, default assumptions, and configuration options.
526
526
 
527
- - **AWS::EC2::Instance** - EC2 instances with on-demand pricing
528
- - **AWS::S3::Bucket** - S3 buckets with storage and request costs
529
- - **AWS::Lambda::Function** - Lambda functions with invocation and duration costs
530
- - **AWS::RDS::DBInstance** - RDS database instances
531
- - **AWS::DynamoDB::Table** - DynamoDB tables with provisioned or on-demand billing
532
- - **AWS::ECS::Service** - ECS services with Fargate or EC2 launch types
533
- - **AWS::ApiGateway::RestApi** - API Gateway REST APIs
534
- - **AWS::ApiGatewayV2::Api** - API Gateway HTTP and WebSocket APIs
527
+ ### Compute
535
528
 
536
- ### Networking Resources (Phase 3 - Current)
529
+ - **AWS::EC2::Instance** - On-demand pricing, configurable hours per month
530
+ - **AWS::AutoScaling::AutoScalingGroup** - Sums underlying EC2 cost
531
+ - **AWS::EC2::LaunchTemplate** - Linked to ASG cost
532
+ - **AWS::EKS::Cluster** - Control plane + node group cost
533
+ - **AWS::Lambda::Function** - Invocation and duration costs
534
+ - **AWS::Batch::JobDefinition** / **AWS::Batch::ComputeEnvironment** - Fargate vCPU/memory (EC2-backed delegates to EC2 pricing)
535
+ - **AWS::AppRunner::Service** - vCPU, memory, request costs *(AWS App Runner is in maintenance mode as of 2026; consider migrating to ECS Express Mode)*
537
536
 
538
- - **AWS::EC2::NatGateway** - NAT Gateways with hourly and data processing costs
539
- - **AWS::ElasticLoadBalancingV2::LoadBalancer** - Application and Network Load Balancers with LCU costs
540
- - **AWS::EC2::VPCEndpoint** - VPC Endpoints (interface and gateway types)
537
+ ### Containers
541
538
 
542
- ### Content Delivery & Caching (Phase 3 - Current)
539
+ - **AWS::ECS::Service** - Fargate or EC2 launch types
540
+ - **AWS::ECS::TaskDefinition** - Fargate task sizing
543
541
 
544
- - **AWS::CloudFront::Distribution** - CloudFront distributions with data transfer and request costs
542
+ ### Storage
543
+
544
+ - **AWS::S3::Bucket** - Storage and request costs
545
+ - **AWS::EFS::FileSystem** - Storage with Infrequent Access tier
546
+ - **AWS::FSx::FileSystem** - Windows, Lustre, ONTAP, OpenZFS
547
+
548
+ ### Database
549
+
550
+ - **AWS::RDS::DBInstance** - Instance + storage
551
+ - **AWS::RDS::DBCluster** (Aurora Serverless v2) - ACU-based pricing
552
+ - **AWS::DynamoDB::Table** - Provisioned or on-demand billing
553
+ - **AWS::DocDB::DBCluster** / **AWS::DocDB::DBInstance** - DocumentDB clusters and instances
554
+ - **AWS::Neptune::DBCluster** / **AWS::Neptune::DBInstance** - Neptune graph database
555
+
556
+ ### Networking
557
+
558
+ - **AWS::EC2::NatGateway** - Hourly + data processing
559
+ - **AWS::ElasticLoadBalancingV2::LoadBalancer** - ALB and NLB with LCU costs
560
+ - **AWS::EC2::VPCEndpoint** - Interface and gateway endpoints
561
+ - **AWS::EC2::TransitGateway** - Attachments + data processed
562
+ - **AWS::Route53::HostedZone** - Hosted zone + query costs
563
+
564
+ ### Content Delivery & Caching
565
+
566
+ - **AWS::CloudFront::Distribution** - Data transfer + requests
567
+ - **AWS::ElastiCache::CacheCluster** / **AWS::ElastiCache::ReplicationGroup** - Node hours
568
+
569
+ ### API Gateway & Serverless
570
+
571
+ - **AWS::ApiGateway::RestApi** - REST API requests
572
+ - **AWS::ApiGatewayV2::Api** - HTTP and WebSocket APIs
573
+ - **AWS::StepFunctions::StateMachine** - Standard and Express workflows
574
+
575
+ ### Messaging & Streaming
576
+
577
+ - **AWS::SNS::Topic** - Publish + delivery costs by protocol
578
+ - **AWS::SQS::Queue** - Standard and FIFO request costs
579
+ - **AWS::Kinesis::Stream** / **AWS::KinesisFirehose::DeliveryStream** / **AWS::KinesisAnalyticsV2::Application** - Shards, ingestion, KPUs
580
+
581
+ ### Analytics
582
+
583
+ - **AWS::Glue::Job** / **AWS::Glue::Crawler** - DPU-hour pricing, DPUs derived from WorkerType/NumberOfWorkers/MaxCapacity
584
+ - **AWS::Athena::WorkGroup** - Per-TB scanned pricing
585
+ - **AWS::Athena::NamedQuery** - Zero cost (charged at query execution time)
586
+
587
+ ### Security
588
+
589
+ - **AWS::SecretsManager::Secret** - Secret storage + API call costs
590
+ - **AWS::WAFv2::WebACL** - Fixed ACL + per-rule + request costs
591
+
592
+ ### Machine Learning
593
+
594
+ - **AWS::SageMaker::Endpoint** - Instance-hour estimate (low confidence; instance type is on linked EndpointConfig)
595
+ - **AWS::SageMaker::NotebookInstance** - Instance-hour pricing
596
+
597
+ ### Monitoring
598
+
599
+ - **AWS::Logs::LogGroup** - Log ingestion
600
+ - **AWS::CloudWatch::Alarm** - Per-alarm cost
601
+ - **AWS::CloudWatch::Dashboard** - Per-dashboard cost
545
602
 
546
603
  ### Coming Soon
547
604
 
548
- - ElastiCache clusters
549
- - EKS clusters
550
- - And more...
605
+ - **AWS::ECS::Service** with Express Mode (AppRunner replacement)
606
+ - And more — track planned support via [open issues](https://github.com/buildinginthecloud/cdk-cost-analyzer/issues)
551
607
 
552
608
  ## Cost Calculation Assumptions
553
609
 
554
- For resources with usage-based pricing, the following default assumptions are used:
555
-
556
- ### Phase 1 Resources
557
- - **S3 Buckets**: 100 GB standard storage, 10,000 GET requests/month
558
- - **Lambda Functions**: 1 million invocations/month, average 1-second duration
559
- - **RDS Instances**: 100 GB storage, single-AZ deployment
560
- - **EC2 Instances**: 730 hours/month (full month), on-demand pricing
561
-
562
- ### Phase 2 Resources
563
- - **DynamoDB Tables (Provisioned)**: 5 read capacity units, 5 write capacity units
564
- - **DynamoDB Tables (On-Demand)**: 10M read requests, 1M write requests per month (configurable)
565
- - **ECS Services (Fargate)**: 0.25 vCPU, 0.5 GB memory per task
566
- - **API Gateway (REST)**: 1M requests per month
567
- - **API Gateway (HTTP)**: 1M requests per month
568
- - **API Gateway (WebSocket)**: 1M messages, 100K connection minutes per month
569
-
570
- ### Phase 3 Resources
571
- - **NAT Gateway**: 500 GB data processed per month
572
- - **Application Load Balancer**: 50 new connections/sec, 5,000 active connections/min, 1,000 GB processed
573
- - **Network Load Balancer**: 100 new connections/sec, 10,000 active connections/min, 1,000 GB processed
574
- - **VPC Endpoint (Interface)**: 100 GB data processed per month
575
- - **CloudFront Distribution**: 100 GB data transfer out, 1M HTTP/HTTPS requests per month
576
-
577
- These assumptions are documented in cost reports and can be customized via configuration file or by extending the calculator classes.
610
+ For resources with usage-based pricing, default assumptions are applied. Each resource section in [docs/CALCULATORS.md](docs/CALCULATORS.md) lists the defaults and how to override them via the `usageAssumptions` block in your configuration file.
611
+
612
+ A small sample:
613
+
614
+ - **EC2 Instance**: 730 hours/month, on-demand Linux pricing
615
+ - **Lambda**: 1M invocations/month, 1-second average duration
616
+ - **S3 Bucket**: 100 GB standard storage, 10,000 GET requests/month
617
+ - **NAT Gateway**: 500 GB data processed/month
618
+ - **CloudFront**: 100 GB data transfer, 1M requests/month
619
+ - **Glue Job/Crawler**: DPUs from template, 50 hours/month runtime
620
+ - **Batch (Fargate)**: 1 vCPU peak (or `MaxvCpus` from template), 100 hours/month
621
+ - **App Runner**: 1 vCPU, 2 GB memory, 1M requests/month, 730 hours/month
622
+ - **Athena WorkGroup**: 1 TB scanned/month
623
+ - **WAF Web ACL**: 1M requests/month
624
+ - **FSx**: storage from template (default 32 GB)
625
+ - **DocumentDB / Neptune Instance**: 730 hours/month, 100 GB storage
626
+
627
+ Override any of these in your config file (see [Configuration](#configuration)) or set them per-resource via `cdk-cost-analyzer.yml`.
578
628
 
579
629
  ## Report Formats
580
630
 
@@ -188,6 +188,80 @@ export interface UsageAssumptionsConfig {
188
188
  /** Number of Kinesis Processing Units for Analytics (default: 2) */
189
189
  kpus?: number;
190
190
  };
191
+ /**
192
+ * WAF (Web Application Firewall) usage assumptions.
193
+ * @see https://aws.amazon.com/waf/pricing/
194
+ */
195
+ waf?: {
196
+ /** Monthly request count (default: 1,000,000) */
197
+ requestsPerMonth?: number;
198
+ };
199
+ /**
200
+ * AWS Glue usage assumptions for ETL jobs and crawlers.
201
+ * @see https://aws.amazon.com/glue/pricing/
202
+ */
203
+ glue?: {
204
+ /** Hours per month the job/crawler runs; DPUs are read from the template (default: 50) */
205
+ hoursPerMonth?: number;
206
+ };
207
+ /**
208
+ * Amazon Athena usage assumptions.
209
+ * @see https://aws.amazon.com/athena/pricing/
210
+ */
211
+ athena?: {
212
+ /** TB of data scanned per month (default: 1) */
213
+ tbScannedPerMonth?: number;
214
+ };
215
+ /**
216
+ * Amazon FSx usage assumptions for file storage cost estimation.
217
+ * @see https://aws.amazon.com/fsx/pricing/
218
+ */
219
+ fsx?: {
220
+ /** Storage capacity override in GB (default: read from resource or 32 GB) */
221
+ storageGB?: number;
222
+ };
223
+ /**
224
+ * Amazon DocumentDB usage assumptions.
225
+ * @see https://aws.amazon.com/documentdb/pricing/
226
+ */
227
+ documentdb?: {
228
+ /** Storage size in GB (default: 100 GB) */
229
+ storageGB?: number;
230
+ };
231
+ /**
232
+ * Amazon Neptune usage assumptions.
233
+ * @see https://aws.amazon.com/neptune/pricing/
234
+ */
235
+ neptune?: {
236
+ /** Storage size in GB (default: 100 GB) */
237
+ storageGB?: number;
238
+ };
239
+ /**
240
+ * Amazon SageMaker usage assumptions.
241
+ * @see https://aws.amazon.com/sagemaker/pricing/
242
+ */
243
+ sagemaker?: {
244
+ /** Hours per month the instance runs (default: 730) */
245
+ hoursPerMonth?: number;
246
+ };
247
+ /**
248
+ * AWS App Runner usage assumptions.
249
+ * @see https://aws.amazon.com/apprunner/pricing/
250
+ */
251
+ appRunner?: {
252
+ /** Monthly request count (default: 1,000,000) */
253
+ requestsPerMonth?: number;
254
+ /** Hours per month the service runs (default: 730) */
255
+ hoursPerMonth?: number;
256
+ };
257
+ /**
258
+ * AWS Batch usage assumptions.
259
+ * @see https://aws.amazon.com/batch/pricing/
260
+ */
261
+ batch?: {
262
+ /** Hours per month the compute environment runs (default: 100) */
263
+ hoursPerMonth?: number;
264
+ };
191
265
  }
192
266
  export interface SynthesisConfig {
193
267
  appPath?: string;