@arinoto/cdk-arch 0.1.1 → 0.1.3
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 +31 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CDK Architecture
|
|
2
|
+
|
|
3
|
+
A set of CDK primitives that allow defining conceptual event-driven solution architectures. This allows to separate design and
|
|
4
|
+
implementation (later done with CDKTF) of which there could be multiple - local, different clouds, etc; generate architecture diagrams
|
|
5
|
+
and, most importantly this allows an easier refactoring of architectures and validation of implementations.
|
|
6
|
+
|
|
7
|
+
Something like this for a hello world that later can be implemented as an AWS ApiGateway with a lambda function and Dynamo,
|
|
8
|
+
or an k8s microservice running in azure in Azure Database for PostgreSQL
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
|
|
12
|
+
export class ApiContainer extends Construct {...}
|
|
13
|
+
export class Function extends Construct {...}
|
|
14
|
+
export class JsonStore extends ApiContainer {...}
|
|
15
|
+
|
|
16
|
+
const arch = new Architecture();
|
|
17
|
+
|
|
18
|
+
const jsonStore = new JsonStore();
|
|
19
|
+
|
|
20
|
+
const api = new ApiContainer(arch, {
|
|
21
|
+
'/v1/api/hello/{name}': new Function(arch, (name: string) => {
|
|
22
|
+
jsonStore.store('greeted', {when: Date.now(), name});
|
|
23
|
+
return `Hello, ${name}!`
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
arch.synth()
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
After that we have C4's system or container definitions (which we can generate as diagrams) and can create a CDKTF definition for its deployment
|
|
31
|
+
that will aditionally validate that all architectural components have corresponding deployment elements.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arinoto/cdk-arch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "CDK Architecture primitives for event-driven solution architectures",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsc",
|
|
17
|
-
"clean": "rm -rf dist"
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"prepublish": "cp ../../IDEA.md ./README.md"
|
|
18
19
|
},
|
|
19
20
|
"keywords": [
|
|
20
21
|
"cdk",
|