cdk-cost-analyzer 0.1.55 → 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.
- package/.cdk-cost-analyzer-cache/metadata.json +8 -8
- package/README.md +92 -42
- package/dist/action/136.index.js +1 -1
- package/dist/action/443.index.js +1 -1
- package/dist/action/605.index.js +12 -6
- package/dist/action/762.index.js +1 -1
- package/dist/action/998.index.js +1 -1
- package/dist/action/config/types.d.ts +74 -0
- package/dist/action/index.js +3 -3
- package/dist/action/pricing/calculators/AppRunnerCalculator.d.ts +24 -0
- package/dist/action/pricing/calculators/AthenaCalculator.d.ts +50 -0
- package/dist/action/pricing/calculators/BatchCalculator.d.ts +14 -0
- package/dist/action/pricing/calculators/DocumentDBCalculator.d.ts +8 -0
- package/dist/action/pricing/calculators/FSxCalculator.d.ts +8 -0
- package/dist/action/pricing/calculators/GlueCalculator.d.ts +26 -0
- package/dist/action/pricing/calculators/NeptuneCalculator.d.ts +8 -0
- package/dist/action/pricing/calculators/SageMakerCalculator.d.ts +12 -0
- package/dist/action/pricing/calculators/WAFCalculator.d.ts +51 -0
- package/dist/action/pricing/calculators/internal/databaseInstanceCost.d.ts +18 -0
- package/dist/config/types.d.ts +74 -0
- package/dist/config/types.js +1 -1
- package/dist/pricing/PricingService.js +19 -1
- package/dist/pricing/calculators/AppRunnerCalculator.d.ts +24 -0
- package/dist/pricing/calculators/AppRunnerCalculator.js +97 -0
- package/dist/pricing/calculators/AthenaCalculator.d.ts +50 -0
- package/dist/pricing/calculators/AthenaCalculator.js +87 -0
- package/dist/pricing/calculators/BatchCalculator.d.ts +14 -0
- package/dist/pricing/calculators/BatchCalculator.js +80 -0
- package/dist/pricing/calculators/DocumentDBCalculator.d.ts +8 -0
- package/dist/pricing/calculators/DocumentDBCalculator.js +37 -0
- package/dist/pricing/calculators/FSxCalculator.d.ts +8 -0
- package/dist/pricing/calculators/FSxCalculator.js +52 -0
- package/dist/pricing/calculators/GlueCalculator.d.ts +26 -0
- package/dist/pricing/calculators/GlueCalculator.js +89 -0
- package/dist/pricing/calculators/NeptuneCalculator.d.ts +8 -0
- package/dist/pricing/calculators/NeptuneCalculator.js +37 -0
- package/dist/pricing/calculators/SageMakerCalculator.d.ts +12 -0
- package/dist/pricing/calculators/SageMakerCalculator.js +71 -0
- package/dist/pricing/calculators/WAFCalculator.d.ts +51 -0
- package/dist/pricing/calculators/WAFCalculator.js +84 -0
- package/dist/pricing/calculators/internal/databaseInstanceCost.d.ts +18 -0
- package/dist/pricing/calculators/internal/databaseInstanceCost.js +67 -0
- package/dist/releasetag.txt +1 -1
- package/docs/CALCULATORS.md +461 -4
- package/package.json +3 -3
|
@@ -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":
|
|
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":
|
|
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":
|
|
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":
|
|
17
|
+
"timestamp": 1780084662512
|
|
18
18
|
},
|
|
19
19
|
"AWSLambda:US East (N. Virginia):group:AWS-Lambda-Requests": {
|
|
20
20
|
"price": 0.023,
|
|
21
|
-
"timestamp":
|
|
21
|
+
"timestamp": 1780084662521
|
|
22
22
|
},
|
|
23
23
|
"AWSLambda:US East (N. Virginia):group:AWS-Lambda-Duration": {
|
|
24
24
|
"price": 0.023,
|
|
25
|
-
"timestamp":
|
|
25
|
+
"timestamp": 1780084662522
|
|
26
26
|
},
|
|
27
27
|
"AmazonS3:EU (Frankfurt):storageClass:General Purpose|volumeType:Standard": {
|
|
28
28
|
"price": 0.023,
|
|
29
|
-
"timestamp":
|
|
29
|
+
"timestamp": 1780084671568
|
|
30
30
|
},
|
|
31
31
|
"AmazonS3:invalid-region-123:storageClass:General Purpose|volumeType:Standard": {
|
|
32
32
|
"price": 0.023,
|
|
33
|
-
"timestamp":
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
539
|
+
- **AWS::ECS::Service** - Fargate or EC2 launch types
|
|
540
|
+
- **AWS::ECS::TaskDefinition** - Fargate task sizing
|
|
543
541
|
|
|
544
|
-
|
|
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
|
-
-
|
|
549
|
-
-
|
|
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,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
- **
|
|
559
|
-
- **
|
|
560
|
-
- **
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
- **
|
|
564
|
-
- **
|
|
565
|
-
- **
|
|
566
|
-
- **
|
|
567
|
-
- **
|
|
568
|
-
- **
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
|
package/dist/action/136.index.js
CHANGED
package/dist/action/443.index.js
CHANGED
package/dist/action/605.index.js
CHANGED
|
@@ -107,11 +107,9 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
107
107
|
}
|
|
108
108
|
const url = new URL(host);
|
|
109
109
|
(0, checkUrl_1.checkUrl)(url, options.logger);
|
|
110
|
-
const requestHandler = node_http_handler_1.NodeHttpHandler.create({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
return (0, retry_wrapper_1.retryWrapper)(async () => {
|
|
110
|
+
const requestHandler = node_http_handler_1.NodeHttpHandler.create({ connectionTimeout: options.timeout ?? 1000 });
|
|
111
|
+
const requestTimeout = options.timeout ?? 1000;
|
|
112
|
+
const provider = (0, retry_wrapper_1.retryWrapper)(async () => {
|
|
115
113
|
const request = (0, requestHelpers_1.createGetRequest)(url);
|
|
116
114
|
if (token) {
|
|
117
115
|
request.headers.Authorization = token;
|
|
@@ -120,13 +118,21 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
120
118
|
request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();
|
|
121
119
|
}
|
|
122
120
|
try {
|
|
123
|
-
const result = await requestHandler.handle(request);
|
|
121
|
+
const result = await requestHandler.handle(request, { requestTimeout });
|
|
124
122
|
return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z"));
|
|
125
123
|
}
|
|
126
124
|
catch (e) {
|
|
127
125
|
throw new config_1.CredentialsProviderError(String(e), { logger: options.logger });
|
|
128
126
|
}
|
|
129
127
|
}, options.maxRetries ?? 3, options.timeout ?? 1000);
|
|
128
|
+
return async () => {
|
|
129
|
+
try {
|
|
130
|
+
return await provider();
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
requestHandler.destroy?.();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
130
136
|
};
|
|
131
137
|
exports.fromHttp = fromHttp;
|
|
132
138
|
|
package/dist/action/762.index.js
CHANGED
package/dist/action/998.index.js
CHANGED
|
@@ -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;
|