@infrascan/fs-connector 0.2.0 → 0.2.2
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 +22 -4
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -2,19 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Infrascan connectors act as the plumbing between the Infrascan SDK and wherever you persist your scan state.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The Fs connector uses the local filesystem. This library exposes a single builder function which takes a base path to use as the directory.
|
|
6
6
|
|
|
7
7
|
All state files are written into the directory in the format: `<account>-<region>-<service>-<function>.json`.
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
+
import Infrascan from "@infrascan/sdk";
|
|
12
13
|
import buildFsConnector from "@infrascan/fs-connector";
|
|
13
|
-
import {
|
|
14
|
+
import { registerAwsScanners } from "@infrascan/aws";
|
|
14
15
|
import { fromIni } from "@aws-sdk/credential-providers";
|
|
15
16
|
|
|
17
|
+
const credentials = fromIni({ profile: "dev" });
|
|
18
|
+
const regions = ["us-east-1","us-west-1"];
|
|
19
|
+
const services = ["SNS","Lambda","S3"];
|
|
20
|
+
|
|
16
21
|
const connector = buildFsConnector('state');
|
|
22
|
+
const infrascan = registerAwsScanners(new Infrascan());
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
infrascan.performScan(
|
|
25
|
+
credentials,
|
|
26
|
+
connector
|
|
27
|
+
).then(function (scanMetadata) {
|
|
28
|
+
console.log("Scan Complete!", scanMetadata);
|
|
29
|
+
return infrascan.generateGraph(
|
|
30
|
+
scanMetadata,
|
|
31
|
+
connector
|
|
32
|
+
);
|
|
33
|
+
}).then(function (graphData) {
|
|
34
|
+
console.log("Graph generated!", graphData);
|
|
35
|
+
}).catch(function (err) {
|
|
36
|
+
console.error("Failed to scan", err);
|
|
37
|
+
});
|
|
20
38
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrascan/fs-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Connector for the Infrascan SDK to read and write state to the local filesystem",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,11 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"target": "node18"
|
|
36
36
|
},
|
|
37
|
-
"keywords": [
|
|
37
|
+
"keywords": [
|
|
38
|
+
"AWS",
|
|
39
|
+
"Infrastructure Diagram",
|
|
40
|
+
"Infrastructure Graph",
|
|
41
|
+
"Cloud Infrastructure",
|
|
42
|
+
"Connector"
|
|
43
|
+
],
|
|
38
44
|
"author": "Liam Farrelly <liam@l3f7.dev> (https://whoisli.am/)",
|
|
39
45
|
"license": "MPL-2.0",
|
|
40
46
|
"devDependencies": {
|
|
41
|
-
"@infrascan/shared-types": "^0.2.
|
|
47
|
+
"@infrascan/shared-types": "^0.2.2",
|
|
42
48
|
"eslint-config-custom": "*",
|
|
43
49
|
"tsconfig": "*",
|
|
44
50
|
"typescript": "^5.1.6"
|