cloudburn 0.9.13 → 0.10.0
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/README.md +3 -1
- package/dist/cli.js +41 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ npx cloudburn scan ./main.tf
|
|
|
23
23
|
|
|
24
24
|
### Config
|
|
25
25
|
|
|
26
|
-
Config is optional. By default, CloudBurn runs
|
|
26
|
+
Config is optional. By default, CloudBurn runs the AWS Core preset for the mode you use. Account-wide rules such as `CLDBRN-AWS-TAGGING-1` are opt-in through `enabled-rules` because they require an accessible Resource Explorer aggregator.
|
|
27
27
|
|
|
28
28
|
Create a starter config with:
|
|
29
29
|
|
|
@@ -67,6 +67,7 @@ cloudburn discover init
|
|
|
67
67
|
cloudburn discover
|
|
68
68
|
cloudburn discover --region eu-central-1
|
|
69
69
|
cloudburn discover --config .cloudburn.yml --enabled-rules CLDBRN-AWS-EBS-1
|
|
70
|
+
cloudburn discover --enabled-rules CLDBRN-AWS-TAGGING-1
|
|
70
71
|
cloudburn discover --service ec2,s3
|
|
71
72
|
cloudburn --debug discover --region eu-central-1
|
|
72
73
|
cloudburn rules list
|
|
@@ -74,6 +75,7 @@ cloudburn rules list --service ec2 --source discovery
|
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
The CLI targets one region per run. Multi-region discovery remains available through the SDK and still needs an AWS Resource Explorer aggregator plus an unfiltered default view in the aggregator region.
|
|
78
|
+
`CLDBRN-AWS-TAGGING-1` is opt-in and requires an accessible aggregator; a local-only setup cannot run account-wide tagging discovery.
|
|
77
79
|
Use `--debug` to print SDK and provider execution tracing to `stderr` without changing the normal `stdout` format.
|
|
78
80
|
|
|
79
81
|
## Shell Completion
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { realpathSync } from "fs";
|
|
5
5
|
import { resolve as resolve2 } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
|
+
import { CommanderError } from "commander";
|
|
7
8
|
|
|
8
9
|
// src/completion/engine.ts
|
|
9
10
|
var buildCompletionTree = (command) => {
|
|
@@ -851,8 +852,9 @@ var renderAsciiTable = (rows, columns) => {
|
|
|
851
852
|
// src/commands/config.ts
|
|
852
853
|
var CONFIG_FILENAMES = [".cloudburn.yml", ".cloudburn.yaml"];
|
|
853
854
|
var starterConfig = `# Static IaC scan configuration.
|
|
854
|
-
# enabled-rules
|
|
855
|
-
#
|
|
855
|
+
# enabled-rules replaces the AWS Core preset with only the listed rule IDs.
|
|
856
|
+
# It can also activate opt-in rules that are not in AWS Core.
|
|
857
|
+
# disabled-rules removes specific rule IDs from the selected set.
|
|
856
858
|
# services restricts scans to rules for the listed services.
|
|
857
859
|
# format sets the default output format when --format is not passed.
|
|
858
860
|
iac:
|
|
@@ -1040,7 +1042,10 @@ var registerConfigCommand = (program) => {
|
|
|
1040
1042
|
};
|
|
1041
1043
|
|
|
1042
1044
|
// src/commands/discover.ts
|
|
1043
|
-
import {
|
|
1045
|
+
import {
|
|
1046
|
+
assertSupportedAwsRegion,
|
|
1047
|
+
CloudBurnClient
|
|
1048
|
+
} from "@cloudburn/sdk";
|
|
1044
1049
|
import { InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
1045
1050
|
|
|
1046
1051
|
// src/debug.ts
|
|
@@ -1058,6 +1063,20 @@ var resolveCliDebugLogger = (command) => {
|
|
|
1058
1063
|
};
|
|
1059
1064
|
};
|
|
1060
1065
|
|
|
1066
|
+
// src/progress.ts
|
|
1067
|
+
var resolveCliDiscoveryProgressLogger = (command) => {
|
|
1068
|
+
if (isDebugEnabled(command) || process.stderr.isTTY !== true) {
|
|
1069
|
+
return void 0;
|
|
1070
|
+
}
|
|
1071
|
+
return (event) => {
|
|
1072
|
+
process.stderr.write(
|
|
1073
|
+
event.kind === "catalog" ? `discover: catalog ready with ${event.resourceCount} resources from ${event.searchRegion}
|
|
1074
|
+
` : `discover: datasets ${event.completedDatasets}/${event.totalDatasets} loaded (${event.datasetKey})
|
|
1075
|
+
`
|
|
1076
|
+
);
|
|
1077
|
+
};
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1061
1080
|
// src/commands/config-options.ts
|
|
1062
1081
|
import { builtInRuleMetadata } from "@cloudburn/sdk";
|
|
1063
1082
|
import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
@@ -1199,11 +1218,11 @@ var registerDiscoverCommand = (program) => {
|
|
|
1199
1218
|
parseAwsRegion
|
|
1200
1219
|
).option("--config <path>", "Explicit CloudBurn config file to load").option(
|
|
1201
1220
|
"--enabled-rules <ruleIds>",
|
|
1202
|
-
"Comma-separated rule IDs to enable. When set, CloudBurn checks only these rules. By default,
|
|
1221
|
+
"Comma-separated rule IDs to enable. When set, CloudBurn checks only these rules. By default, AWS Core preset rules are enabled.",
|
|
1203
1222
|
parseRuleIdList
|
|
1204
1223
|
).option(
|
|
1205
1224
|
"--disabled-rules <ruleIds>",
|
|
1206
|
-
"Comma-separated rule IDs to disable
|
|
1225
|
+
"Comma-separated rule IDs to disable from the default AWS Core preset.",
|
|
1207
1226
|
parseRuleIdList
|
|
1208
1227
|
).option(
|
|
1209
1228
|
"--service <services>",
|
|
@@ -1212,6 +1231,7 @@ var registerDiscoverCommand = (program) => {
|
|
|
1212
1231
|
).option("--exit-code", "Exit with code 1 when findings exist").action(async (options, command) => {
|
|
1213
1232
|
await runCommand(async () => {
|
|
1214
1233
|
const debugLogger = resolveCliDebugLogger(command);
|
|
1234
|
+
const onProgress = resolveCliDiscoveryProgressLogger(command);
|
|
1215
1235
|
const scanner = new CloudBurnClient({ debugLogger });
|
|
1216
1236
|
const configOverride = toDiscoveryConfigOverride(options);
|
|
1217
1237
|
const loadedConfig = await scanner.loadConfig(options.config);
|
|
@@ -1224,6 +1244,9 @@ var registerDiscoverCommand = (program) => {
|
|
|
1224
1244
|
if (options.config !== void 0) {
|
|
1225
1245
|
discoveryOptions.configPath = options.config;
|
|
1226
1246
|
}
|
|
1247
|
+
if (onProgress !== void 0) {
|
|
1248
|
+
discoveryOptions.onProgress = onProgress;
|
|
1249
|
+
}
|
|
1227
1250
|
const result = await scanner.discover(discoveryOptions);
|
|
1228
1251
|
const format = resolveOutputFormat(command, void 0, loadedConfig.discovery.format ?? "table");
|
|
1229
1252
|
const output = renderResponse({ kind: "scan-result", result }, format);
|
|
@@ -1442,11 +1465,11 @@ var registerScanCommand = (program) => {
|
|
|
1442
1465
|
setCommandExamples(
|
|
1443
1466
|
program.command("scan").description("Run an autodetected static IaC scan").argument("[path]", "Terraform file, CloudFormation template, or directory to scan").option("--config <path>", "Explicit CloudBurn config file to load").option(
|
|
1444
1467
|
"--enabled-rules <ruleIds>",
|
|
1445
|
-
"Comma-separated rule IDs to enable. When set, CloudBurn checks only these rules. By default,
|
|
1468
|
+
"Comma-separated rule IDs to enable. When set, CloudBurn checks only these rules. By default, AWS Core preset rules are enabled.",
|
|
1446
1469
|
parseRuleIdList
|
|
1447
1470
|
).option(
|
|
1448
1471
|
"--disabled-rules <ruleIds>",
|
|
1449
|
-
"Comma-separated rule IDs to disable
|
|
1472
|
+
"Comma-separated rule IDs to disable from the default AWS Core preset.",
|
|
1450
1473
|
parseRuleIdList
|
|
1451
1474
|
).option("--service <services>", "Comma-separated services to include in the scan rule set.", parseIaCServiceList).option("--exit-code", "Exit with code 1 when findings exist").action(async (path, options, command) => {
|
|
1452
1475
|
try {
|
|
@@ -1491,8 +1514,9 @@ var isCliEntrypoint = (moduleUrl, argvEntry = process.argv[1]) => {
|
|
|
1491
1514
|
};
|
|
1492
1515
|
var createProgram = () => {
|
|
1493
1516
|
const program = createCliCommand();
|
|
1494
|
-
program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.
|
|
1517
|
+
program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.10.0").option("--debug", "Write execution trace messages to stderr").option("--format <format>", OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat);
|
|
1495
1518
|
configureCliHelp(program);
|
|
1519
|
+
program.exitOverride();
|
|
1496
1520
|
registerCompletionCommand(program);
|
|
1497
1521
|
registerConfigCommand(program);
|
|
1498
1522
|
registerDiscoverCommand(program);
|
|
@@ -1502,7 +1526,15 @@ var createProgram = () => {
|
|
|
1502
1526
|
return program;
|
|
1503
1527
|
};
|
|
1504
1528
|
var runCli = async () => {
|
|
1505
|
-
|
|
1529
|
+
try {
|
|
1530
|
+
await createProgram().parseAsync(process.argv);
|
|
1531
|
+
} catch (err) {
|
|
1532
|
+
if (err instanceof CommanderError) {
|
|
1533
|
+
process.exitCode = err.exitCode === 0 ? EXIT_CODE_OK : EXIT_CODE_RUNTIME_ERROR;
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
throw err;
|
|
1537
|
+
}
|
|
1506
1538
|
};
|
|
1507
1539
|
if (isCliEntrypoint(import.meta.url)) {
|
|
1508
1540
|
await runCli();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudburn",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Cloudburn CLI for cloud cost optimization",
|
|
5
5
|
"homepage": "https://cloudburn.io/docs",
|
|
6
6
|
"bugs": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"commander": "^13.1.0",
|
|
23
|
-
"@cloudburn/sdk": "0.
|
|
23
|
+
"@cloudburn/sdk": "0.24.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "^2.5.3",
|